in reply to Re: Getting previous dates from the current date
in thread Getting previous dates from the current date

DateTime is also very good.

I agree; the DateTime suite is excellent: it has a very well-thought-out interface, does pretty much anything that any of the other modules do, and correctly covers all the awkward corners of date- and time-handling that you don't want to think about.

This thread has a bunch of different responses, but none of them look to me anywhere near as simple as:

print DateTime->now->subtract(days => 7)->date

Update: And, after actually bothering to read the other suggestions (rather than just noticing how complicated they look), the hand-rolled ones (avoiding modules for the date arithmetic) all seem to be wrong as well. So that's another advantage of DateTime: it quietly gets correct things that you haven't even bothered to think about.

Smylers