We help IT Professionals succeed at work.

DateTime function question

Bang-O-Matic
Bang-O-Matic asked
on
251 Views
Last Modified: 2014-04-30
If I have a dateTime field in MySQL database and is formatted like : 2014-03-30 02:00:00

but i only want to use the date portion, how would you extract that? code example appreciated!

Thanks!
Comment
Watch Question

GanapathiFacets Developer
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
TomMicrosoft ISV Partner

Commented:
All about it here:
https://wikidocs.adDateTimeFormatobe.com/wiki/display/coldfusionen/
Read the comments some correction to the code.

And don't forget to replace the tag "todayDateTime" with the field name from sql

Author

Commented:
Maybe I did not ask the question correctly.
I already have many records in my database with dateTime  field and they are formatted like:
2014-03-30 02:00:00
2013-05-03 06:00:00

I want to extract just the date portion and use that as a coldfusion variable.
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
GanapathiFacets Developer

Commented:
While selecting the data from database, use the below function for the date column

DATE(date_column_name)

You will get yyyy-mm-dd

Author

Commented:
Thank you! I have split the points.
TomMicrosoft ISV Partner

Commented:
#DateTimeFormat(SQLLabelName, "yyyy.MM.dd")#
This will mask out the date
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.