Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: Convert Date formats

by Krambambuli (Curate)
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,


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://821125]
shmem serves tea along with the cookies. (☕) x @CBMonks
[shmem]: hmm.. which makes emerge the question: is there a way to attach a subroutine to a variable, which is run as soon as that variable changes?
[moritz]: through a tie?
[shmem]: moritz: of course!
shmem slaps forehead m(
[shmem]: consider, then, @CBMonks as a tied variable which triggers withdrawing empty cups and serving new ones

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (10)
As of 2017-04-24 12:21 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (439 votes). Check out past polls.