You need to get the current date/time from the server.

The Now() function can be used to obtain the current date/time from the ColdFusion server:

<cfoutput>#Now()#</cfoutput>

The current date/time is returned as a date/time object, formatted as a timestamp:

{ts '2002-04-01 10:04:17'}

The object is formatted as {ts 'yyyy-mm-dd HH:mm:ss'} where ts indicates a time stamp. The date is formatted as a four-digit year followed by a two-digit month and a two-digit day. The time portion of the object is formatted for a 24-hour clock. Hours, minutes, and seconds are all formatted using two digits.

This question was written by Rob Brooks-Bilson
It was last updated on January 5, 2006.

Categories

Dates/Times

Comments

comments powered by Disqus