Dusty
asked on
DateTime function question
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!
but i only want to use the date portion, how would you extract that? code example appreciated!
Thanks!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
While selecting the data from database, use the below function for the date column
DATE(date_column_name)
You will get yyyy-mm-dd
DATE(date_column_name)
You will get yyyy-mm-dd
ASKER
Thank you! I have split the points.
#DateTimeFormat(SQLLabelNa me, "yyyy.MM.dd")#
This will mask out the date
This will mask out the date
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