Skip to main content

review.formats.parse_time

review.formats.parse_time(stamp)

The moment a time stamp of the files names, in UTC; None if it names none.

The one parser of every time in the review files. A stamp has the shape 2026-01-31T09:30:00Z and must also be a date of the calendar, so 2026-13-45T25:61:61Z is None.

Parameters

Name Type Description Default
stamp str The text of a time field. required

Returns

Name Type Description
datetime | None datetime | None: The moment, with the time zone UTC, or None.

Examples

from babregen.review.formats import parse_time

print(parse_time("2026-01-31T09:30:00Z"), parse_time("2026-13-45T25:61:61Z"))
2026-01-31 09:30:00+00:00 None