Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Date::Parse - how to correctly parse dates between 1901 and 1969

by johngg (Canon)
on Feb 19, 2018 at 23:27 UTC ( [id://1209517]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
        my $tp = Time::Piece->strptime( $date, q{%Y-%m-%d %T} );
        say $date, q{ -> epoch }, $tp->epoch();
    }
    
  2. or download this
    1960-12-31 23:59:59 -> epoch -283996801
    1966-06-24 09:44:00 -> epoch -111161760
    ...
    1901-01-01 00:00:00 -> epoch -2177452800
    1900-01-01 00:00:00 -> epoch -2208988800
    Error parsing time at /usr/lib/x86_64-linux-gnu/perl/5.22/Time/Piece.p
    +m line 469.
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-03-29 07:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found