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'}


Fork me on GitHub