Re: [Tutor] timedelta doesnt do month

2007-02-06 Thread Kent Johnson
Alan Gauld wrote: > "Kent Johnson" <[EMAIL PROTECTED]> wrote > >> Because of the ambiguities of month arithmetic (what is 2005-1-31 >> plus >> one month?) datetime refuses to guess and does not support this. > >> The third-party dateutil module is not as circumspect: >> >> In [1]: import datetim

Re: [Tutor] timedelta doesnt do month

2007-02-06 Thread Alan Gauld
"Kent Johnson" <[EMAIL PROTECTED]> wrote > Because of the ambiguities of month arithmetic (what is 2005-1-31 > plus > one month?) datetime refuses to guess and does not support this. > The third-party dateutil module is not as circumspect: > > In [1]: import datetime > > In [2]: startdate = date

Re: [Tutor] timedelta doesnt do month

2007-02-05 Thread frank h.
thanks kent for your fast and comprehensive answer! On 2/5/07, Kent Johnson <[EMAIL PROTECTED]> wrote: frank h. wrote: > so what is the easiest way to to get to a list of months in a given > timeinterval, e.g. > > >> startdate = datetime.date(2005,2,13) > >> enddate = datetime.date(2007,1,25)

Re: [Tutor] timedelta doesnt do month

2007-02-05 Thread Kent Johnson
frank h. wrote: > so what is the easiest way to to get to a list of months in a given > timeinterval, e.g. > > >> startdate = datetime.date(2005,2,13) > >> enddate = datetime.date(2007,1,25) > >> delta = enddate - startdate > >> delta.days > 711 > >> delta.months > exceptions.AttributeError

[Tutor] timedelta doesnt do month

2007-02-05 Thread frank h.
so what is the easiest way to to get to a list of months in a given timeinterval, e.g. startdate = datetime.date(2005,2,13) enddate = datetime.date(2007,1,25) delta = enddate - startdate delta.days 711 delta.months exceptions.AttributeErrorTraceback (most recent ca