timedelta_from_isoformat#
- openstef_core.utils.timedelta_from_isoformat(s: str) timedelta[source]#
Convert ISO 8601 string format to timedelta.
- Parameters:
s (str) – ISO 8601 duration string to parse.
- Returns:
Python timedelta object representing the duration.
- Return type:
timedelta
Example
Parse a 15-minute interval:
>>> td = timedelta_from_isoformat('PT15M') >>> td.total_seconds() 900.0
- Parameters:
s (
str)- Return type:
timedelta