in reply to Adding To Dates

perldoc -f localtime

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 +) ;

_______________
DamnDirtyApe
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
    thanks peeps. I should have spotted that. I would use the Date::Calc to do it, but i wanted to do it without additional modules