Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^5: formatting datetime with strftime

by poj (Prior)
on Jul 22, 2013 at 15:36 UTC ( #1045678=note: print w/replies, xml ) Need Help??


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 +ear+100);
poj

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1045678]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (9)
As of 2017-10-18 20:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (250 votes). Check out past polls.

    Notices?