-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Closed as not planned
Labels
Description
Bug report
Bug description:
Does timdelta work only positive value ?
sd1 is just 1 min faster than sd2
result of sd1 - sd2 is 86340 in second
sd2 - sd1 is 60 second
here is sample code
Version is Python 3.13 on Windows
'``python
import datetime
sd1 = '250323 0933'
sd2 = '25/03/23 09:34'
d1 = datetime.datetime.strptime(sd1, '%y%m%d %H%M')
d2 = datetime.datetime.strptime(sd2, '%y/%m/%d %H:%M')
print(f"d1: {d1} \nd2: {d2} \nd1-d2: {d1-d2} {(d1-d2).seconds} \nd2-d1: {d2-d1} {(d2-d1).seconds}")
Result:s
d1: 2025-03-23 09:33:00
d2: 2025-03-23 09:34:00
d1-d2: -1 day, 23:59:00 86340
d2-d1: 0:01:00 60
### CPython versions tested on:
3.13
### Operating systems tested on:
Windows