in reply to The opposite of localtime()
Hi,
Time::Piece is also a easy module. you can refer Time::Piece module for the localtime..It's an Object Oriented time objects. From the object you can get the year, month , day and also using the strftime you can get any format of localtime. Refer the sample code given below..
use Time::Piece; my $t = localtime; print "Time is $t\n"; print "Year is ", $t->year, "\n"; print $t->strftime("%a, %d %b %Y");
|
|---|