Hi All,

 I am using the Time::localtime module in my perl script for getting a
particular date format. It was working fine till last month, but for the
month of October it is seen that it's showing as September. I am pasting a
copy of my code below:

sub getLocalTime
{
 my $tm = localtime;
 my ($day, $month, $year, $hour, $min, $sec) = ($tm->mday, $tm->mon,
$tm->year, $tm->hour, $tm->min, $tm->sec);
 $year = 1900 + $year;
 my $enddate = "$month-$day-$year $hour:$min:$sec";
}

For example if the system date is "Fri Oct  8 00:24:21 2010" the module is
returning "9-8-2010 0:25:21".

Just wanted to confirm whether its a bug in the module or whether I am doing
something wrong here.


Thanks,

GK.

Reply via email to