Connecting Tech Pros Worldwide Help | Site Map

Where does Now() get the date/time?

Familiar Sight
 
Join Date: Sep 2007
Posts: 221
#1: Mar 11 '08
I was under the impression that the Now() function retrieved the date/time from the server running coldfusion, but that doesn't seem to be the case. Ever since the time change my server shows for example: 1:40pm but when I look at the output of the Now() function I'm getting 12:40pm.

Any ideas on how to fix this?
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#2: Mar 11 '08

re: Where does Now() get the date/time?


According to the documentation, it is from the server running Coldfusion.

Are you using TimeFormat to output the time?
Familiar Sight
 
Join Date: Sep 2007
Posts: 221
#3: Mar 11 '08

re: Where does Now() get the date/time?


Quote:

Originally Posted by acoder

According to the documentation, it is from the server running Coldfusion.

Are you using TimeFormat to output the time?

That's what I thought too. I'm using timeformat to format the time. Here's my code I'm using to validate.

Expand|Select|Wrap|Line Numbers
  1. <cfoutput>Date/Time Loaded: &nbsp;#DateFormat(Now(),"mmm dd yy")# #TimeFormat(Now(),"HH:mm")#</cfoutput>
  2.  
I've tried restarting Coldfusion and IIS but I'm still getting the incorrect time.
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#4: Mar 12 '08

re: Where does Now() get the date/time?


Perhaps you need to look into getTimeZoneInfo().
Familiar Sight
 
Join Date: Sep 2007
Posts: 221
#5: Mar 12 '08

re: Where does Now() get the date/time?


Quote:

Originally Posted by acoder

Perhaps you need to look into getTimeZoneInfo().

I figured it out. I had upgraded to JVM 1.4.2_11 when I was running CF 6, but then I upgraded to CF 7 and it changed my path to the JVM. I swapped it back, and all is well now.

http://www.adobe.com/go/d2ab4470
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#6: Mar 12 '08

re: Where does Now() get the date/time?


Glad you found the solution and thanks for posting! I think those DST changes in the US have been asked about in the JavaScript forum too.
Reply