Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Answer: How can I format the output of localtime?

by Roy Johnson (Monsignor)
on Feb 11, 2004 at 16:52 UTC ( #328312=categorized answer: print w/replies, xml ) Need Help??

Q&A > dates and times > How can I format the output of localtime? - Answer contributed by Roy Johnson

If you want to do it without using any modules, and you want the m/d/y (or d/m/y, season to taste) format,
# Assuming you've got $timeval from a stat() call or some such my ($d,$m,$y) = (localtime($timeval))[3,4,5]; my $mdy = sprintf '%d/%d/%d', $m+1, $d, $y+1900;

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2020-10-31 07:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (287 votes). Check out past polls.

    Notices?