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

Re: Convert Date formats

by almut (Canon)
on Feb 03, 2010 at 10:42 UTC ( [id://821121]=note: print w/replies, xml ) Need Help??


in reply to Convert Date formats

You could prepend a day (e.g. 01) to help ParseDate() disambiguate the input format:

print UnixDate( ParseDate( 'NOV-07'), '%Y-%m-%d' ), "\n"; print UnixDate( ParseDate('01-NOV-07'), '%Y-%m-%d' ), "\n"; __END__ 2010-11-07 2007-11-01

Also, why do you specify '%Y-%m-%d' as the output format when what you say you want is '%Y/%m'?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-24 21:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found