Re: Changes in USA's Daylight Savings Time (DST)
by Zaxo (Archbishop) on Aug 08, 2005 at 19:51 UTC
|
We should start preparing panicky press releases. This could be another Y2K boom if we play it right.
| [reply] |
Re: Changes in USA's Daylight Savings Time (DST)
by jfroebe (Parson) on Aug 08, 2005 at 20:12 UTC
|
Hi,
As the Daylight Savings Time varies quite radically within the United States (let alone elsewhere), a lookup table for applications is probably a good idea anyways regardless of the new law. A related note: I prefer to have the database systems running on UTC time and let the client application handle the conversion to the appropriate time zone.
Jason L. Froebe
Team Sybase member No one has seen what you have seen, and until that happens, we're all going to think that you're nuts. - Jack O'Neil, Stargate SG-1
| [reply] |
Re: Changes in USA's Daylight Savings Time (DST)
by japhy (Canon) on Aug 08, 2005 at 20:40 UTC
|
While this is not necessarily specific to the days on which DST starts and ends, this is relevant advice I always give on this matter: when doing date arithmetic without the use of Date:: modules, always always ALWAYS use a neutral time of day. If you need to get a Unix time for a given day, choose a time like noon:
use Time::Local;
my $time = timelocal(0,0,12, (localtime)[3,4,5]);
This way, you can add and subtract days worth of seconds from $time without worrying about DST.
| [reply] [d/l] |
|
|
I'm sorry, I don't understand. What is a "neutral" time?
| [reply] |
|
|
A "neutral" time is an hour of the day that will not cause you skip or double a day when going over a daylight savings time boundary.
| [reply] |
|
|
Hi,
When dealing with a small set of time zones (Eastern through Pacific for example) one can drop the hours to determine the number of days between two datetimes.
2:05pm would become 12 noon. 1am would become 12 noon. So the # of days between 05:02 Aug 4, 2005 and 10:08pm Aug 10, 2005 is 6 days not 6.xxx days The granularity is a day so a small number of calculations in this manner would provide fairly accurate # of days. With a large number of calcuations, the truncating of the hours will start to become an issue.
It's a quick and dirty hack that is often sufficient for many things. We often will drop the hours when we count back in our heads.
Jason L. Froebe
Team Sybase member No one has seen what you have seen, and until that happens, we're all going to think that you're nuts. - Jack O'Neil, Stargate SG-1
| [reply] |
Re: Changes in USA's Daylight Savings Time (DST)
by jk2addict (Chaplain) on Aug 08, 2005 at 19:53 UTC
|
The one thing I keep thinking about is calculations of elapsed time between two dates, esp if the older date is pre 1987 DST changes and the second date is post 2007 changes and one of those are not in GMT.
| [reply] |
Re: Changes in USA's Daylight Savings Time (DST)
by halley (Prior) on Aug 09, 2005 at 01:48 UTC
|
To further my reputation for inserting tangential trivia instead of just answering a question, let me mention that it is Daylight Saving Time, not Savings. It's not a bank like "First Federal Savings and Loan."
-- [ e d @ h a l l e y . c c ]
| [reply] |
|
|
Hi,
Thanks :) I grew up knowing it with the extra s. You are correct and to our credit, many text books list it one way or the other. (in some cases, it will be listed with the extra s in one section and without in another.
Thanks for letting us know the correct spelling. I definitely ++ your post :)
Jason L. Froebe
Team Sybase member No one has seen what you have seen, and until that happens, we're all going to think that you're nuts. - Jack O'Neil, Stargate SG-1
| [reply] |
|
|
To further my reputation for inserting tangential trivia instead of just answering a question, let me mention that it is Daylight Saving Time, not Savings.
Well if you're going to be picky, surely a compound preposed adjective should have a hyphen in it:
- "daylight-saving time" parses as "time with daylight saving", which is presumably what is intended.
- "daylight saving time" parses as "saving time with daylight". I've no idea what "saving time" is (as a noun), but perhaps it's something to do with that bank you mentioned ...
To put it in Perl terms: adjectives are right-associative.
Smylers
| [reply] |
|
|
| [reply] |
|
|
| [reply] [d/l] |
|
|
Re: Changes in USA's Daylight Savings Time (DST)
by anonymized user 468275 (Curate) on Aug 08, 2005 at 21:21 UTC
|
Of course, in the unlikely event that a system for some reason makes itself responsible for daylight saving time calculations, e.g. by having a local database of DSTs, then it would need updating. I am not at my own machine to download and check perl's Time::Local, which any decent perl-based system will depend on one way or another, but its maintainers have a mailing list at datetime-subscribe@perl.org
| [reply] |