Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is Coldfusion DateTime returning strange values?

I'm trying to use the Coldfusion DateFormat Function. Can someone tell me, why doing this:

 #DateFormat( now(), "YYYY-MM-DD HH:MM:SS")#

returns this:

 2012-07-17 16:07:666

Why the 666 milliseconds? something devilish???

like image 655
frequent Avatar asked Jan 17 '23 02:01

frequent


1 Answers

DateFormat does not format time. Use TimeFormat for time.

Edit:

Use this code for date-time output.

#dateFormat(now(),'YYYY-MM-DD')# #timeFormat(now(), 'HH:MM:SS')#
like image 51
Sean Coyne Avatar answered Jan 31 '23 06:01

Sean Coyne