[docs] Little mistake on datetime page

Sandro Tosi sandro.tosi at gmail.com
Thu Aug 18 15:09:07 CEST 2011


Hello,
thanks for your email.

2011/8/18 Геннадий Пилипенко <utyf at utyf.net>:
> Hello!
>
> http://docs.python.org/library/datetime.html#timedelta-objects
>
> In examples:
>
> ---
>
>>>> ten_years = 10 * year
>>>> ten_years, ten_years.days // 365
> (datetime.timedelta(3650), 10)
>
> ---
>
> should be:
>
> ---
>
>>>> ten_years = 10 * year
>>>> ten_years, ten_years.days // 3650
> (datetime.timedelta(3650), 3650)

Could you please explain why? If I understand it correctly, what the
example tries to show is that the number of days in ten_years divided
the number of days in a year is 10, which is expected.

Also:

>>> ten_years, ten_years.days // 3650
(datetime.timedelta(3650), 1)

Regards
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi


More information about the docs mailing list