Daylight Saving Time Revisited

I've posted about DST issues in the past, but we recently had an issue at work so I thought I'd share my findings again. According to the Adobe Technote "Working with daylight savings [sic] time in ColdFusion MX":

The current time is calculated correctly in Macromedia ColdFusion MX and higher, regardless of whether the Automatically Adjust Clock for Daylight Saving Changes option is enabled or disabled in the computer's Control panel Date/Time Properties. In previous versions of ColdFusion, the current time would be offset by one hour when this option was disabled.

The Technote goes on to state:

  • Enable this option when you want your computer's clock to automatically adjust for daylight saving time.
  • Disable this option when you want a user to make the adjustment for daylight saving time.

It sounds like the Technote is saying that when in daylight saving time you can disable the Automatically Adjust Clock for Daylight Saving Changes option, set the clock to the daylight saving time (ahead one hour) and ColdFusion will still return the correct time. This, however, is not the case.

I'm in the Eastern Time Zone for the US and we are currently observing daylight saving time. If I go into the control panel and disable the Automatically Adjust Clock for Daylight Saving Changes option the time is rolled back one hour the time zone is reported as Eastern Standard Time. (Note that with the option selected the time zone is reported as Eastern Daylight Time.)

Now 12:19:08 PM is the correct time for Eastern Standard Time, but we are in Eastern Daylight Time, so I move the time ahead one hour to display the "correct" time of 1:19:08 PM. If I run a ColdFusion page which outputs #Now()# I will now see the time reported as 2:19:08 PM. Why? Java is trying to adjust for DST. It knows we are in EDT and it thinks the time being reported by Windows is EST so it adds an hour to display the correct local time. Java, and hence ColdFusion, has no way of knowing we have already adjusted for DST.

So, if you are going to disable the Automatically Adjust Clock for Daylight Saving Changes option, be sure to set your clock to the correct Standard time. And if you are syncing to a local time server, be sure its settings are correct as well.

Related Blog Entries

Comments
BlogCFC was created by Raymond Camden. This blog is running version 5.8.001.