gordias.util.time_string.parse_time#

gordias.util.time_string.parse_time(time: str) datetime#

Parse a time string to a datetime.datetime object.

This function parses a time string in non-iso format. The following formats is currently supported: “%Y”, “%Y%m”, “%Y%m%d”, “%Y%m%d%H”, “%Y%m%d%H%M”, “%Y%m%d%H%M%S”.

Parameters:

time (str) – String to parse.

Returns:

The parsed time.

Return type:

datetime.datetime

Raises:

ValueError – If the time could not be parsed.