in reply to formatting datetime with strftime
Perhaps you could employ Date::Manip instead of doing it all by hand
use Date::Manip; print UnixDate('05/1/13 16:45 GMT', '%b %d %Y %T %Z'); [download]
May 01 2013 16:45:00 GMT [download]