|
|
Home /
Groups /
ColdFusion Server (CF-Server)
ColdFusion DateDiff across timezone wrong since DST
I have a different take on the CF timezone issues. First off our serversWil Genovese 03/20/08 01:15 P That's not actually an error. Since your timespan is across the nightCameron Childress 03/20/08 03:04 P I wasn't even going to mention the problem with scheduler, but one of theWil Genovese 03/20/08 04:07 P Wil Genovese wrote:Paul Hastings 03/20/08 06:58 P I have a different take on the CF timezone issues. First off our servers are and have been adjusted for DST correctly. They shifted automatically without issues, now() returns the correct time for our servers in the Central timezone. I did however notice a datediff() issue. If your doing a datediff across the spring DST time shift your get weird results that are an hour off. Use this link to see the code I'm using and an example of the output. This is on a BlueDragon server, but if you run the code on CF7 or CF8 you will get similar incorrect values. http://www.wilgeno.com/duration.cfm That's not actually an error. Since your timespan is across the night daylight savings changed, there is one less hour in it than there otherwise would be. That's right, the hour between 2 and 3 AM on the night of the time change is skipped. That day only has 23 hours in it. And in autumn there is a day with 25 hours in it. So... it's not an error. Move your timespan to a timespan that doesn't include DST change and I'll bet it starts working as expected.... Also.... Any CF scheduled event set to go at 2:30AM that night also would not fire because that hour doesn't exist on that night. And it would fire twice in the fall. Trippy huh? -Cameron Wil Genovese wrote: ----- Excess quoted text cut - see Original Post for more ----- I wasn't even going to mention the problem with scheduler, but one of the scheduled tasks we have was scheduled before the time change to run daily at 2am. Since the time change it has been running at 1am. That is wrong since the servers time is correct. If I change the the task to run at 3am it runs at 3am and if I set it to run at 1am it runs at 1am. Only when the time starts in the 2am hour does the task run in the 1am hour. However, if I change the start date of the task to be after the time change then set the task to run at 2am the task will then run at 2am. Any and all tasks that run daily at 2am and where the start date of that task is during daylight savings time will run at 2am regardless of whether or not the actual date is in savings or standard time. If the start date is in the standard time date range then tasks at 2am will be executed at 1am. That is trippy. Wil On Thu, Mar 20, 2008 at 2:04 PM, Cameron Childress <cameronc@gmail.com> wrote: ----- Excess quoted text cut - see Original Post for more ----- Wil Genovese wrote: > That is trippy. naw, that's timezone hell.
|
Mailing Lists
|
Latest Fusion Authority Articles
|
||||||