MCPcopy Create free account
hub / github.com/tiny-pilot/tinypilot / parse

Function parse

app/iso8601.py:18–29  ·  view source on GitHub ↗

Parses an ISO-8601-formatted string into a datetime object. Args: iso_8601_string: The ISO-8601-formatted string to parse (e.g., '2021-02-10T085735Z'). Returns: A datetime object corresponding to the input string in UTC timezone.

(iso_8601_string)

Source from the content-addressed store, hash-verified

16
17
18def parse(iso_8601_string):
19 """Parses an ISO-8601-formatted string into a datetime object.
20
21 Args:
22 iso_8601_string: The ISO-8601-formatted string to parse (e.g.,
23 '2021-02-10T085735Z').
24
25 Returns:
26 A datetime object corresponding to the input string in UTC timezone.
27 """
28 return datetime.datetime.strptime(
29 iso_8601_string, _ISO_8601_FORMAT).replace(tzinfo=datetime.timezone.utc)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected