The stupid question is the question not asked | |
PerlMonks |
Re: Converting epoch times after 2038by jonadab (Parson) |
on Apr 05, 2007 at 10:28 UTC ( [id://608441]=note: print w/replies, xml ) | Need Help?? |
I too would consider it more a bug than a feature, nonetheless, it seems to be true. I'm getting 7pm Dec 31, 1969 with that one-liner. This is perl, v5.8.8 built for i386-freebsd-64int, running on a 32-bit x86 architecture (Celeron IIRC). One supposes this means perl is relying too heavily on the underlying C library for certain things. However, the DateTime::Format::Epoch::Unix code that ikegami posted works fine, so maybe the moral of the story is to always use DateTime modules when you're handling dates and times. (I've been doing that for years anyway, because it's better in other ways. A 2038 bug in localtime would just be the icing on the cake.) --
We're working on a six-year set of freely redistributable Vacation Bible School materials.
In Section
Seekers of Perl Wisdom
|
|