[Tutor] datetime.timedelta Output Format
William Allison
allison.william at comcast.net
Mon Apr 2 20:53:22 CEST 2007
Kent Johnson wrote:
>
> It looks like Gustavo Niemeyer's dateutil module will at least do the
> year/month/day calculation if not the formatting:
>
> In [1]: from datetime import date
> In [2]: from dateutil import relativedelta
> In [3]: now = date.today()
> In [9]: rd = relativedelta.relativedelta(now, tafmsd)
> In [10]: rd
> Out[10]: relativedelta(years=+13, months=+1, days=+10)
>
> http://labix.org/python-dateutil
>
> Kent
>
Thank you, seems to be just what I was looking for!
Will
More information about the Tutor
mailing list