Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Convert Date formats

by Krambambuli (Deacon)
on Feb 03, 2010 at 11:10 UTC ( #821125=note: print w/ replies, xml ) Need Help??


in reply to Convert Date formats

If you want to stay with Date::Manip, you'll have to feed the parser with a valid date: 'NOV-07' is not a date, but a month (there is no day specified).

Taking care of that, the following code works:

#!/usr/bin/perl use strict; use warnings; use Date::Manip; my $thingy = 'NOV-2007'; my $date = UnixDate( ParseDate( "1-$thingy" ), '%Y/%m' ); print "$date\n";
Good luck,

Krambambuli
---


Comment on Re: Convert Date formats
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (13)
As of 2014-12-22 16:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (121 votes), past polls