gfw.common.datetime.datetime_from_isoformat#

datetime_from_isoformat(s, tz=datetime.timezone.utc)[source]#

Converts a datetime string to a timezone-aware datetime.

Parameters:
  • s (str) – The string to convert, in ISO 8601 format (e.g., 2025-04-30T10:20:30).

  • tz (tzinfo) – The timezone to apply to the resulting datetime, if not present. Defaults to UTC.

Returns:

A timezone-aware datetime object.

Return type:

datetime