Chris Knipe wrote:
> 
> Lo all,

Hello,

> How can I convert a date such as '18 Jun, 2002 at 11:00:00 (SAT)' into a
> DD/MM/YYYY HH:MM string?
> 
> I've been on google for quite some time now, and looked at quite a few CPAN
> stuff, but I can't seem to find anything converting that specific format?


$ perl -le'
my %mons = qw/Jan 1 Feb 2 Mar 3 Apr 4 May 5 Jun 6 Jul 7 Aug 8 Sep 9 Oct
10 Nov 11 Dec 12/;
my $mon = join "|", keys %mons;

$_ = q/18 Jun, 2002 at 11:00:00 (SAT)/;

if ( /(\d+)\s+($mon),\s+(\d+)\s+\S+\s+(\d+:\d+):/ ) {
    $date = sprintf q[%02d/%02d/%04d %s], $1, $mons{$2}, $3, $4;
    }

print $date;
'
18/06/2002 11:00



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to