Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Answer: How do I find today's date?

by vroom (Pope)
on Jan 19, 2000 at 00:33 UTC ( #2159=categorized answer: print w/replies, xml ) Need Help??

Q&A > dates and times > How do I find today's date? - Answer contributed by vroom

use localtime or Time::localtime
my($day, $month, $year)=(localtime)[3,4,5]; print "$day-".($month+1)."-".($year+1900)."\n"; # or use Time::localtime; $tm=localtime; my ($day,$month,$year)=($tm->mday,$tm->month,$tm->year);
Edited to fix precedence errors in localtime() version as noted by 3dbc

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2017-03-23 16:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (290 votes). Check out past polls.