now

Gets the current date and time of the computer running
the CFML server.

now() → returns date

Examples
Sample code invoking the now function

Let's display the current server datetime using script.

writeOutput( 'The current date and time is: ' & now() );

Expected Result: The current date and time is: {ts '2014-03-19 15:27:42'}

Let's display the current server datetime using tagged CFML.

<p>The current date and time is: <cfoutput>#now()#</cfoutput></p>

Expected Result: The current date and time is: {ts '2014-03-19 15:27:42'}

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub