Why can't timedeltas be divided?

Maric Michaud maric at aristote.info
Wed May 24 18:25:45 EDT 2006


Le Jeudi 25 Mai 2006 00:07, Dan Bishop a écrit :
> If I try to write something like:
>
>     num_weeks = time_diff / datetime.timedelta(days=7)

because it has no meaning, what you want is :

num_weeks = time_diff.days / 7
or
num_weeks = (time_diff / 7).days


-- 
_____________

Maric Michaud
_____________

Aristote - www.aristote.info
3 place des tapis
69004 Lyon
Tel: +33 426 880 097



More information about the Python-list mailing list