← Back to Users
perlgnome's activity in the archive.
The month value you get runs from 0 .. 11, with 0 being January, so you need to add 1 to it to get your "real" month number. my($day, $month, $year) = (localtime())[3..5]; $year += 1900; $month += 1; print "$year-$month-$day\n";
The month value you get runs from 0 .. 11, with 0 being January, so you need to add 1 to it to get your "real" month number.
my($day, $month, $year) = (localtime())[3..5];
$year += 1900;
$month += 1;
print "$year-$month-$day\n";