Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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

by Anonymous Monk
on Feb 20, 2018 at 21:10 UTC ( [id://1209613]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Date::Parse - how to correctly parse dates between 1901 and 1969
in thread Date::Parse - how to correctly parse dates between 1901 and 1969

#!/usr/bin/perl -- use strict; use warnings; use DateTime; use DateTime::Format::Natural; my @dates = ( "2018-02-20 00:00:00", "20180220", "02/20/2018", "02/20/18", # interpreted as 1918-02-20 "2018-02-20", "today", "now", ); my $dfn = DateTime::Format::Natural->new; print $dfn->parse_datetime($_),$/ for @dates; __END__ 2018-02-20T00:00:00 2018-02-20T21:12:19 2018-02-20T21:12:19 2018-02-20T21:12:19 2018-02-20T00:00:00 2018-02-20T00:00:00 2018-02-20T21:12:19
  • Comment on Re^4: Date::Parse - how to correctly parse dates between 1901 and 1969
  • Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-04-18 18:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found