I have a script to calculate the warranty the period of one year.I add 365 days of current date.I got the correct output for the year 2007 but the 2008 year calculation getting incorrect value.please anybody explain me what is happening here.
[CODE=perl]#!/usr/bin/perl
use Time::Local;
my $time=timelocal (0,0,0,21,4,200 7);
my $warrenty="";
$warrenty=local time($time+60*6 0*24*365);
print $warrenty;
print "\n";
$warrenty=local time(time()+60* 60*24*365);
print $warrenty;
[/CODE]
The output
--------------
Tue May 20 00:00:00 2008
Thu May 21 12:29:46 2009
Regards
Rajiv
[CODE=perl]#!/usr/bin/perl
use Time::Local;
my $time=timelocal (0,0,0,21,4,200 7);
my $warrenty="";
$warrenty=local time($time+60*6 0*24*365);
print $warrenty;
print "\n";
$warrenty=local time(time()+60* 60*24*365);
print $warrenty;
[/CODE]
The output
--------------
Tue May 20 00:00:00 2008
Thu May 21 12:29:46 2009
Regards
Rajiv
Comment