There's more than one way to do things | |
PerlMonks |
Re: epoch timeby jbert (Priest) |
on Jan 31, 2007 at 17:36 UTC ( [id://597579]=note: print w/replies, xml ) | Need Help?? |
The first rule of coding club is: "never implement your own date/time/timezone handling code".
The above advice about Time::Local is good, but if it weren't, your best option would be to effectively copy the code you need from one of the modules you listed. If you were to consider doing it yourself, don't forget to think about whether you need to take account of: timezones (numeric), timezones (named), leap years, leap seconds, daylight savings time (in all the different timezones, changing over the years) and how comprehensive your test suite needs to be. I think timezones possibly also move on a scale of decades. Also don't forget to think about whether someone else will be calling your code for similar purposes but who does need to worry about such things. (The second rule of coding club is "never implement your own character escaping/unicode/charset conversion code").
In Section
Seekers of Perl Wisdom
|
|