3
如何在Python 2.4中獲取月前日期?Python中的relativedelta 2.4
在Python 2.5很容易:
onemonthago = datetime.date.today() + relativedelta(months = -1)
如何在Python 2.4中獲取月前日期?Python中的relativedelta 2.4
在Python 2.5很容易:
onemonthago = datetime.date.today() + relativedelta(months = -1)
relativedelta
是python-dateutil功能,dateutil的python2.4是兼容的,所以你應該能夠使用相同的,如果你已經安裝了dateutil。