Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

RE: Date format question

by Adam (Vicar)
on Sep 12, 2000 at 03:48 UTC ( [id://32023]=note: print w/replies, xml ) Need Help??


in reply to Date format question

@_ = (0,1,1900); $_ = sprintf '%4d.%02d.%02d', map {$_+pop @_} reverse +(localtime)[3.. +5]; # $_ = 2000.09.11 on Sept 11th, 2000. # Another way that is more readable is: my( $day, $month, $year ) = (localtime)[3..5]; $_ = sprintf '%4d.%02d.%02d', 1900+$year, ++$month, $day;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://32023]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2024-03-28 14:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found