House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

Daylight Savings & Scheduled Tasks

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Terry Ford
03/11/2010 08:44 PM

I have had the following problem the last couple of time changes, and would like to know if there is a simple solution to fix it: I have a number of tasks that I need to run just after midnight, local time (CT), whether it's standard CST or daylight CDT.  12:01 AM.   I use CF scheduler with settings "run daily at 12:01 AM".   However, whenever we hit a daylight savings and switch between CST and CDT, ColdFusion tries to be smart and adjusts that starting time by 1 hour, which means that the tasks start running at 11:01 PM CT.     What I'd like to say is "run daily at 12:01 AM CT", so that it runs at 12:01 regardless of whether we're in daylight savings or not.   Is there a way to do this in scheduler? The work around is to wait for daylight savings to occur and then go in and resubmit all of those tasks to again run at "12:01 AM".  It then starts working correctly until the next time change.  This, however, is a very annoying solution. Thanks

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Andrew Scott
03/11/2010 09:20 PM

I personally would not have DST switched on for a server, and have it disabled. But I guess the only other solution would be to have the script run before the DTS changes, don't know how the computers do it but the DTS should change at a given time so you might want to make sure the task is run after that or before that time. I have had the following problem the last couple of time changes, and would like to know if there is a simple solution to fix it: I have a number of tasks that I need to run just after midnight, local time (CT), whether it's standard CST or daylight CDT.  12:01 AM.   I use CF scheduler with settings "run daily at 12:01 AM".   However, whenever we hit a daylight savings and switch between CST and CDT, ColdFusion tries to be smart and adjusts that starting time by 1 hour, which means that the tasks start running at 11:01 PM CT.     What I'd like to say is "run daily at 12:01 AM CT", so that it runs at 12:01 regardless of whether we're in daylight savings or not.   Is there a way to do this in scheduler? The work around is to wait for daylight savings to occur and then go in and resubmit all of those tasks to again run at "12:01 AM".  It then starts working correctly until the next time change.  This, however, is a very annoying solution. Thanks

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Terry Ford
03/11/2010 10:55 PM

>I personally would not have DST switched on for a server, and have it >disabled Thanks for the response.   I just switched DST off on the server (RHEL linux: ln -s /usr/share/zoneinfo/Etc/GMT+6 localtime). However, the scheduler.log is still picking up CST somehow after a CF reboot: "task -- Rescheduling for :Thu Mar 11 22:45:00 CST 2010" Do you have any idea how CF picks up server timezone?  I would have thought that the JVM would have picked up that change.  I'm not sure where CF is getting that CST from.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Brad Wood
03/11/2010 11:17 PM

I usually use the following JVM arg (I'm in the central time zone): -Duser.timezone=America/Chicago ~Brad > Do you have any idea how CF picks up server timezone?  I would have > thought that the JVM would have picked up that change.  I'm not sure where > CF is getting that CST from.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Terry Ford
03/13/2010 05:57 PM

>I usually use the following JVM arg (I'm in the central time zone): >-Duser.timezone=America/Chicago Hmm, thanks...  but am still a little confused. What determines whether coldfusion/CFScheduler switches to daylight savings time? (A) the timezone settings in the OS or (B) settings in the JVM? I have told the OS to ignore daylight savings time ("use GMT-6 all year, every year").  Is the JVM going to override that based on its own internal timezone data and say "hey, GMT-6 sounds like it's central time, so therefore it's time for daylight savings time", or will it respect the OS's timezone data and keep ColdFusion on GMT-6? Thanks

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Matt Quackenbush
03/13/2010 06:26 PM

CF relies on the JVM for time zone settings.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Andrew Scott
03/11/2010 11:20 PM

When making changes to the local and region settings ColdFusion must be restarted, I am assuming you did that? >I personally would not have DST switched on for a server, and have it >disabled Thanks for the response.   I just switched DST off on the server (RHEL linux: ln -s /usr/share/zoneinfo/Etc/GMT+6 localtime). However, the scheduler.log is still picking up CST somehow after a CF reboot: "task -- Rescheduling for :Thu Mar 11 22:45:00 CST 2010" Do you have any idea how CF picks up server timezone?  I would have thought that the JVM would have picked up that change.  I'm not sure where CF is getting that CST from.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Kym Kovan
03/11/2010 09:41 PM

On 12/03/2010 12:33, Terry Ford wrote: > > I have had the following problem the last couple of time changes, and would like to know if there is a simple solution to fix it: > > I have a number of tasks that I need to run just after midnight, local time (CT), whether it's standard CST or daylight CDT.  12:01 AM. > > I use CF scheduler with settings "run daily at 12:01 AM".   However, whenever we hit a daylight savings and switch between CST and CDT, ColdFusion tries to be smart and adjusts that starting time by 1 hour, which means that the tasks start running at 11:01 PM CT. To me that sounds more like the server is staying on Standard Time. That is a fairly common scenario in most hosting companies. How to handle the daylight savings changes goes in the same basket as how do you handle different time zones and the answer is dependent on what your site is doing. Our advice to clients for "simple" sites is to have a switch in some convenient spot, code (Application.cfc) or database, to flag daylight saving status and have a global variable with "adjustedNow()" in it. For more complex site where you might be working over many time zones or international users then you need to make it more complex. -- Yours, Kym Kovan mbcomms.net.au


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

July 31, 2010

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
         1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31