There's more than one way to do things | |
PerlMonks |
Re^2: Data: Dates, a DateTime replacement to perlfaq4 (TZ nit)by BigLug (Chaplain) |
on Oct 08, 2005 at 07:00 UTC ( [id://498375]=note: print w/replies, xml ) | Need Help?? |
I've seen you make this point several times in the chatterbox, including claiming that this was required for accurately dealing with date-times represented as epoch-seconds.
Thanks tye, you are right that I have, in the past, made this claim. I'll also point out though that I've been convinced of the error of my ways, and admitted so in the Chatterbox, and so no longer make this claim. To reiterate, if all you care about is elapsed seconds (what we've started to call UTC math on the DateTime mailing list) then the time zone is irrelevent, and so is DateTime: two calls to the time() command and you're done. However, if you later want to turn that duration into non-second data (eg. days and months, or even minutes), then you need { My claim, however, still remains that this is the only perl module using the Olson Time Zone database - on *nix systems as well as windows. Sure the operating system may use the database, and by playing with your TZ environment variable you can probably convert datetimes from one time zone into another. In fact I know you can do all of the above tasks without the DateTime module: read the original perlfaq4. The difference is that you cannot interrogate the Olson Time Zone data that is in the operating system. There is no way to ask it when the change-over from standard to summer occurs. All you can do with the OS database is keep firing epochs until you find a 3600 second discrepency. Update: You really just need something that understands the human calendar (not clock), like ... DateTime.
In Section
Meditations
|
|