- or download this
use strict;
use warnings;
use Time::Piece;
...
my $t2 = localtime;
print "Time is $t2\n";
print "Year is ", $t2->year, "\n";
- or download this
Time is Tue Dec 13 22:57:39 2005
Year is 2005
- or download this
$t->year # based at 0 (year 0 AD is, of course 1 BC)
$t->_year # year minus 1900