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

an alternative with DateTime

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

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


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
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.