On Tue, 31 Aug 2021 03:59:52 -0700 (PDT), dcs3spp via Python-list
<[email protected]> declaimed the following:
>I cannot understand why the resultant datetime.timedelta is days=-1,
>seconds=82800 (23 hours) .
>
Read the documentation...
https://docs.python.org/3/library/datetime.html#timedelta-objects
>Why is it not an hour earlier as seconds=-3600? Why is days = -1 when the
>resultant calculated date is the same, year, day, month??
"""
and days, seconds and microseconds are then normalized so that the
representation is unique, with
0 <= microseconds < 1000000
0 <= seconds < 3600*24 (the number of seconds in one day)
-999999999 <= days <= 999999999
"""
Note that microseconds and seconds are ALWAYS normalized to be a positive
integer. So your input on -3600 is normalized to +82800 from the previous
day.
--
Wulfraed Dennis Lee Bieber AF6VN
[email protected] http://wlfraed.microdiversity.freeddns.org/
--
https://mail.python.org/mailman/listinfo/python-list