in reply to Final date conversion happiness script

#!/usr/local/bin/perl -w use strict; use warnings; use Date::Parse; # date strings in various format my @date = ( 'Apr 8 1984', 'Apr 08 84', '4/8/84', '04/08/84', '08 Apr 1984' ); my @months = qw/ January February March April May June July August September October November December /; foreach (@date) { my ($day,$month,$year) = (strptime $_)[3,4,5]; printf "%s %d %d\n", $months[$month], $day, $year + 1900; }

And the output -
April 8 1984 April 8 1984 April 8 1984 April 8 1984 April 8 1984

Replies are listed 'Best First'.
Re: Re: Final date conversion happiness script
by ctp (Beadle) on Jan 13, 2004 at 00:26 UTC
    Ah, yes...I am really looking forward to being allowed to use modules in this class!!! Thanks for the code, btw.