You may like some of the date-related modules mentioned on The Perl Advent Calendar. See the articles on Date::Parse and DateTime.
However, my absolute favorite modules for this is Date::Manip. It does an amazing job of recognizing almost any date format. Here's some working code for your example:
$ perl -MDate::Manip -e'print UnixDate("20050519112656","%m-%d-%Y %I:% +M %p %Z\n")' 05-19-2005 11:26 AM EDT
Notice that I didn't have to say what format the input was in!
In reply to Re: formatting mysql timestamp
by kaif
in thread formatting mysql timestamp
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |