Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
It functions ok for adding 14 days to the current date, but it seems to deduct 1 month from the current date also. i.e if the date is 2002-02-02 it will change it to 2002-01-16 any ideas where i am going wrong? Thanks#Take Current System Date And Add Two Weeks On For Trial use constant WEEK => 60 * 60 * 24 * 7 ; my @later = localtime( time + ( WEEK * 2 ) ) ; my $expiry_date = sprintf "%04d-%02d-%02d", $later[5] + 1900, $later[4], $later[3] ;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Adding To Dates
by DamnDirtyApe (Curate) on Aug 13, 2002 at 16:07 UTC | |
by jimbobn (Novice) on Aug 13, 2002 at 16:33 UTC | |
|
Re: Adding To Dates
by adrianh (Chancellor) on Aug 13, 2002 at 16:19 UTC |