This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

java.util.Timer and timezone switch  RSS feed

 
Brian Percival
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure if this is the right forum.
If I have TimerTasks scheduled for say sometime in future and the host machine is set on auto adjust for day light savings time, what is the behavior? (i know i know I can just wait and see what happens on Sunday. But I am looking for a quick theoritical explanation)

If my machine is on central time with day light savings time on, and today (when we follow CDT), I set up a timertask for 5:00 AM Nov 1st, will it run fine?
 
Mike Simmons
Ranch Hand
Posts: 3090
14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It should run fine, yes - assuming you initialize the time correctly in the first place, using Java classes that understand time zones - either a Calendar or DateFormatter can be used here. (I usually prefer the latter.) On the other hand, if you started the timer on 10/31 at 5:00 AM and told it to run every 24 hours, then it would run at 5 AM on 10/31, and 4 AM on 11/1.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!