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
In reply to Re: Adding To Dates
by DamnDirtyApe
in thread Adding To Dates
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |