#!/usr/bin/perl -w use strict; $_ = "[27/Feb/2002:05:05:51 -0800]"; my %months = ( Jan => '01', Feb => '02', # ... Dec => '12', ); m|\[(\d*)/(\D*)/(\d*):(\d*:\d*:\d*) [^\]]*\]|; print "$3-$months{$2}-$1 $4"; #### #!/usr/bin/perl -w use strict; use Date::Manip; $_ = "[27/Feb/2002:05:05:51 -0800]"; s/\[|\]//g; # Strip the brackets for Date::Manip $_ = ParseDate($_); s/://g; # Strip the colons for MySQL print;