Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

an alternative with DateTime

by mojotoad (Monsignor)
on Nov 18, 2005 at 05:10 UTC ( [id://509689]=note: print w/replies, xml ) Need Help??


in reply to Time::Piece strangeness

#!/usr/bin/perl use DateTime::Format::Strptime; my $strp = DateTime::Format::Strptime->new( pattern => '%d-%m-%Y', on_error => 'croak', ); my $dt = $strp->parse_datetime("31-02-2006"); print $dt->datetime, "\n";
results: "Invalid day of month (day = 31 - month = 02)"

You can assign any handler you want to 'on_error'

Cheers,
Matt

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-19 09:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found