Junix
Junix

Reputation: 195

relativedelta in Python 2.4

How can I get the month-ago date in Python 2.4?

In Python 2.5 it's easy:

onemonthago = datetime.date.today() + relativedelta(months = -1)

Upvotes: 3

Views: 6924

Answers (1)

number5
number5

Reputation: 16443

relativedelta is a python-dateutil function, and dateutil is python2.4 compatible, so you should be able to use the same if you have dateutil installed.

Upvotes: 3

Related Questions