in reply to Converting epoch times after 2038

are you using DateTime::Format::Epoch or the default one?

Replies are listed 'Best First'.
Re^2: Converting epoch times after 2038
by kurre_vaxholm (Acolyte) on Apr 05, 2007 at 06:51 UTC
    I am using the default one. Do you think that DateTime::Format::Epoch will do the trick?? I'll look it up on CPAN...

      Apparently, it does:

      use DateTime qw( ); use DateTime::Format::Epoch qw( ); my $epoch = DateTime->new( year => 1970, month => 1, day => 1 ); my $formatter = DateTime::Format::Epoch->new( epoch => $epoch ); my $dt = $formatter->parse_datetime( 3700771200 ); print( $dt->strftime( '%x %X' ), "\n" ); # Apr 10, 2087 12:00:00 AM

      Update: Better yet:

      use DateTime::Format::Epoch::Unix qw( ); my $dt = DateTime::Format::Epoch::Unix->parse_datetime( 3700771200 ); print( $dt->strftime( '%x %X' ), "\n" ); # Apr 10, 2087 12:00:00 AM
        Hi ikegami Thanks for the response. Are you on a 64 bit system or a 32?? Cause 32 bit system can only handle epoch before 2038 (2**32) if they rely on the unix built in timegm..