• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Time offset (DST?) in CF server now() values.

New Here ,
Mar 28, 2010 Mar 28, 2010

Copy link to clipboard

Copied

This is WEIRD.

We have two CF servers, ver 7.? and 8.? on different boxes.

7.0 is production, 8.0 developer.

In the 7.0 server we see the value of now() being 1 hour different from the value of now() in the 8.0 server.

Both servers within the Windows environment show the same time value in the system tray.

Nowhere do we see - never looked for it - a Daylight Savings time override in CF 8.0.  Is there one?

Why should it be different than Windows itself.

Both servers are running Windows 2000 Server.  Ok, they boxes aren't QUITE as old!

Our workaround is to save data to our DB server based on a getdate() value in the DB server rather than bogus data.

Are we overlooking something REALLY simple?

Robert

Views

4.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 28, 2010 Mar 28, 2010

Copy link to clipboard

Copied

Check the TZ SETTING.  I think it is in the JVM config.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 28, 2010 Mar 28, 2010

Copy link to clipboard

Copied

Thanks for the reply ...

Unfortunately that does not seem to be the culprit ...

The JVM Argument field looks like:

-server -Dsun.io.useCanonCaches=false -XX:MaxPermSize=192m -XX:+UseParallelGC -Dcoldfusion.rootDir={application.home}/../ -Dcoldfusion.libPath={application.home}/../lib

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 28, 2010 Mar 28, 2010

Copy link to clipboard

Copied

You don't have an old unpatched JVM do you?

http://www.theregister.co.uk/2007/03/09/java_time_bug/

--

Adam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 28, 2010 Mar 28, 2010

Copy link to clipboard

Copied

Read the article with thanks.

Based on their description, it would not affect a simple now() as it seems to need to include time zone references.

In addition, as of last night, the UK is on the same time zone we are on ... (client has a UK office) ... but this server was purchased in the USA in their US data centre.

I am lost ... how does one update JAVA on a server?

Speaking of OLD, their production server is older than the dev box by 2-3 years so I would suspect the other way 'round.

I did just reboot the dev box on a prayer (should have tried that sooner) and no luck.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 28, 2010 Mar 28, 2010

Copy link to clipboard

Copied

what does this tell you? is it the same for both servers (the tzName should be,

the JRE for cf7 & cf8 should be different)?

");

</cfscript

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 28, 2010 Mar 28, 2010

Copy link to clipboard

Copied

What tzName?  There is no reference to tzName in the JVM arguments in either server.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 28, 2010 Mar 28, 2010

Copy link to clipboard

Copied

rats, the forums swallowed my off-the-top-of-my-head-code. it doesn't like tags

in email responses. pretend this is wrapped in cfscript tags & there's br tags

in the output:

tz=createObject("java","java.util.TimeZone").getDefault();

tzName=tz.getDisplayname(true, tz.LONG); // default tz long name, DST if used

jre=createObject("java","java.lang.System");

JREname=jre.getProperty("java.runtime.name");

JREversion=jre.getProperty("java.runtime.version");

writeoutput("JRE: #JREname# #JREVersion# timezone: #tzName#");

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 29, 2010 Mar 29, 2010

Copy link to clipboard

Copied

When I run that cfscript on the CF8 box, I get ..

JRE: Java(TM) SE Runtime Environment 1.6.0_04-b12 timezone: Central Daylight Time

On the CF7 ox ...

JRE: Java(TM) 2 Runtime Environment, Standard Edition 1.4.2_05-b04 timezone: Central Daylight Time

As it's the CF7 box that is working fine, I would think I would leave IT alone! ? 

Is the the JVM Version number as well?

Robert

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Mar 29, 2010 Mar 29, 2010

Copy link to clipboard

Copied

The 1.4.2_05 version of the JVM does not account for daylight saving time changes. You should update to a newer JVM, 1.4.2_11 or 1.4.2_15, to address your time zone issues. This is covered in the link I posted previously.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 29, 2010 Mar 29, 2010

Copy link to clipboard

Copied

But that's the box that IS working!

It's the CF8 box that isn't, (and the CF7 being production AND being replaced in 6 months, we're not touching a box thats working fine.)

Robert

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 29, 2010 Mar 29, 2010

Copy link to clipboard

Copied

perhaps you've just got things twisted around?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 29, 2010 Mar 29, 2010

Copy link to clipboard

Copied

Just in case my brain was fried, I just checked it and rechedked it! ... no, nothing is twisted around ...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 30, 2010 Mar 30, 2010

Copy link to clipboard

Copied

what exactly is your reference that the cf8 server is an hour off & is the

server that's wrong?

does getTimeZoneInfo() return the same data for both servers?

i think that "JR" is correct & the cf7 box should be the "wrong" one & you might

need to update the JDK. can't quite understand why you think the cf8 box is the

"wrong" one.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 30, 2010 Mar 30, 2010

Copy link to clipboard

Copied

Ok, we ran that code snippet and the snippet from Adobbe docs ... on both servers ...

On the CF8 box, the one that where now is an hour off the system clock, we get

Total offset in seconds is 18000.

Offset in hours is 5.

Offset in minutes minus the offset in hours is    0.

Is Daylight Savings Time in effect? YES.

On the CF7 box ...which yields the correct time.

Total offset in seconds is 21600.

Offset in hours is 6.

Offset in minutes minus the offset in hours is    0.

Is Daylight Savings Time in effect? NO.

----

Both servers (Windows boxes) are set to Central Time, Observe Daylight Savings time.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 30, 2010 Mar 30, 2010

Copy link to clipboard

Copied

if you run the testbed here:

http://www.sustainablegis.com/projects/tz/testTZCFC.cfm

and pick your tz (CST, etc.) it says you're in DST. guess cf7 is wrong (as "JR"

already noted) unless you're in one of those regions that doesn't observe DST?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 30, 2010 Mar 30, 2010

Copy link to clipboard

Copied

Really appreciate all these suggestions ...

on the box that is working corectly ... cf7.

server datetime ::  30-Mar-10  02:37 PM
server timezone ::  Central Daylight Time
selected timezone ::  America/Chicago
raw offset ::  - 6.00 hrs
offset ::  - 5.00 hrs
DST savings ::  + 1.00 hrs
uses DST ::  YES
in DST ::  YES
cast to UTC ::  30-Mar-10  07:37 PM
cast from UTC ::  30-Mar-10  09:37 AM
cast to server ::  30-Mar-10  02:37 PM
cast from server ::  30-Mar-10  02:37 PM

------------------------------------------------

on the box that is NOT working ... almost exactly the same.

server datetime ::     30-Mar-10  02:43 PM
server timezone ::     Central Daylight Time
selected timezone ::     America/Chicago
raw offset ::     - 6.00 hrs
offset ::     - 5.00 hrs
DST savings ::     + 1.00 hrs
uses DST ::     YES
in DST ::     YES
cast to UTC ::     30-Mar-10  07:43 PM
cast from UTC ::     30-Mar-10  09:43 AM
cast to server ::     30-Mar-10  02:43 PM
cast from server ::     30-Mar-10  02:43 PM

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 31, 2010 Mar 31, 2010

Copy link to clipboard

Copied

LATEST

unfortunately my tz CFC works independent of the cf serve tz so its going to

give you correct tz results no matter what, i was only using it as a reference

to point out that your cf7 box looks to be setup wrong. as of today CST tz is

in DST.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Mar 29, 2010 Mar 29, 2010

Copy link to clipboard

Copied

What JVM is your CF7 server running?

I suspect that you will need to update the JVM on your CF7 server.  See reference from Adobe below.

http://go.adobe.com/kb/ts_d2ab4470_en-us

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 29, 2010 Mar 29, 2010

Copy link to clipboard

Copied

JVM version ... is that the same as below?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation