http://www.perlmonks.org?node_id=1045684


in reply to formatting datetime with strftime

Time::Piece, (was first released with perl v5.9.5), would solve this simply.
#!/usr/bin/perl use strict; use warnings; use Time::Piece; my $datetimestring = "4/5/13 16:09"; my $t = Time::Piece->strptime($datetimestring, "%m/%d/%y %H:%M"); print $t->strftime("%b %d, %Y %H:%M:%S");
Prints Apr 05, 2013 16:09:00

Chris