Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Converting epoch times after 2038

by zer (Deacon)
on Apr 05, 2007 at 06:35 UTC ( [id://608423]=note: print w/replies, xml ) Need Help??


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..

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://608423]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-25 11:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found