in reply to
Re^4: formatting datetime with strftime
in thread formatting datetime with strftime
The order of your arguments is wrong, it should be
strftime(fmt, sec, min, hour, mday, mon, year) where mon begins at zero and year is since 1900.
my $datetimestring = "5/4/13 16:09";
my ($month,$day,$year,$hour,$min) = split /\D/,$datetimestring;
my $str = strftime("%b %d %Y %H:%M:%S", 0,$min,$hour,$day,$month-1,$y
By rote learning.
Via Genetic memory.
It's provided by my firmware.
I just remember them.
Thirty days hath September
My computer gets it right, usually.
I just ask someone else.
Someone punches me on the first of the month.
Results (43 votes),