There are lots and lots of pitfalls in date arithmetic (leap seconds, February, leap years etc), so don't mess with dates when someone else has done it for you. Browse CPAN for an appropriate Date class (Class::Date, Date::Calc etc) and use that for all your date display formatting and calculations.