in reply to Adding To Dates
localtime returns 0..11 to represent the months. So, just use $later[4] + 1 in your sprintf statement instead.
Update: Incidentally, Date::Calc gives you a very clean way to do this.
use Date::Calc qw( Today Add_Delta_Days ) ; my $expiry_date = sprintf "%04d-%02d-%02d", Add_Delta_Days( Today, 14 +) ;
Those who know that they are profound strive for clarity. Those who
would like to seem profound to the crowd strive for obscurity.
--Friedrich Nietzsche
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Adding To Dates
by jimbobn (Novice) on Aug 13, 2002 at 16:33 UTC |