Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Date format

by bjelli (Pilgrim)
on Mar 19, 2001 at 21:22 UTC ( #65465=note: print w/replies, xml ) Need Help??


in reply to Date format

Just my 0.2 XP's worth:

sub date { my($sec,$min,$h,$mday,$month,$year) = localtime(time); $year += 1900; # 2-digit year (eg. 101 = 2001) $month += 1; # month is counted from 0 return sprintf "%02d-%02d-%04d", $month, $mday, $year; }

PS: if your audience is international: don't use that format. I'm from Austria, I'm used to interpreting xx-xx-xxxx as DD-MM-YYYY. You might want to use YYYY-MM-DD instead, to avoid this confusion.

--
Brigitte    'I never met a chocolate I didnt like'    Jellinek
http://www.horus.com/~bjelli/         http://perlwelt.horus.at

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (1)
As of 2018-02-23 05:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (300 votes). Check out past polls.

    Notices?