Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: How can I format the output of localtime?

by Roy Johnson (Monsignor)
on Feb 11, 2004 at 16:52 UTC ( [id://328312]=note: print w/replies, xml ) Need Help??


in reply to How can I format the output of localtime?

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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://328312]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (None)
    As of 2024-04-25 00:00 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found