isoduration
isoduration copied to clipboard
Can't add duration to datetime.
With Python 3.11.6 (main, Nov 27 2023, 16:51:41) [Clang 15.0.0 (clang-1500.0.40.1)] on darwin:
import datetime
from isoduration import parse_duration
dt=datetime.datetime.fromisoformat('2024-12-13T17:50:08.406635Z')
dur=parse_duration('PT57M51.76S')
print(dt+dur)
ValueError: second must be in 0..59
confirmed the problem is with the fractional seconds in the duration. These are parsed correctly but not added correctly.