in reply to How to get the current Date and Time using Perl on windows?
Hi
You can use the time function in perl as
my ($sec,$min,$hour,$day,$month,$yr19,@rest) = localtime(time);##### +##To get the localtime of your system print "Date:\t$day-".++$month. "-".($yr19+1900)."\n"; ####To print dat +e format as expected print "Time:\t".sprintf("%02d",$hour).":".sprintf("%02d",$min).":".spr +intf("%02d",$sec)."\n";###To print the current time
Punitha
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: How to get the current Date and Time using Perl on windows?
by johngg (Canon) on Jan 02, 2008 at 11:29 UTC |
In Section
Seekers of Perl Wisdom