View comments | RSS feed
Contents > CFML Reference > ColdFusion Functions > Now PreviousNext

Now

Gets the current date and time of the computer running the ColdFusion server. The return value can be passed as a parameter to date functions such as DaysInYear or FirstDayOfMonth.

A date/time object; the current date and time of the computer running the ColdFusion server.

Date and time functions

Now()

CreateDateTime, DatePart

<h3>Now Example</h3>
<p>Now returns the current date and time as a valid date/time object.

<p>The current date/time value is <cfoutput>#Now()#</cfoutput>
<p>You can also represent this as <cfoutput>#DateFormat(Now())#,
 #TimeFormat(Now())#</cfoutput>

Contents > CFML Reference > ColdFusion Functions > Now PreviousNext

ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6.1

Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.

Comments


No screen name said on Aug 20, 2003 at 1:12 AM :
Now() returns the "date and time of the computer".
In particular, this means it change for daylight savings time by itself.
This may not be the case for any external programs.

We came across this setting an Expires header (based on a sometimes-BST date),
when the Date header was being added by our J2EE container - in GMT.
SMooTHG said on Oct 10, 2004 at 6:58 PM :
We have encountered a bizarre problem where as we run a simple cold fusion page, with <CFOUTPUT>#Now()#</CFOUTPUT> and the date and time is about 10-12 hours behind the system clock.

The locale is set accordingly ( to English - Australian ) and the clock is correct, the 'NET TIME' command returns the correct time ( as displayed by the desktop clock ) but the #Now()# feature returns a time approx 10 hours before the system clock. Where does #NOW()# actually pull its time from?
jrunrandy said on Oct 11, 2004 at 4:55 AM :
Now() returns the following:

new Date( System.currentTimeMillis())

In OleDateTime format. The OleDateTime constructor calls java.util.Date.getTime(), which is the number of milliseconds since January 1, 1970, 00:00:00 GMT.
jefferson_petilo said on Oct 21, 2004 at 8:45 AM :
I'm having serious problems with daylight on ColdFusion MX 6.1 on Slackware 10, Because Brazil does not use static daylight time dates. The start and end dates for daylight time in Brazil are different each year.

I adjusted the dates to this year on the Slackware, but the ColdFusion didn't change. It continues considering the 'default' as if he was on daylight period. Exists any way to change it?

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functa47.htm