MCPcopy Index your code
hub / github.com/DeepL/deepl-python / parse_timestamp

Function parse_timestamp

deepl/util.py:191–195  ·  view source on GitHub ↗
(creation_time: str)

Source from the content-addressed store, hash-verified

189
190
191def parse_timestamp(creation_time: str) -> datetime.datetime:
192 # Truncate fractional seconds to 6 digits (microseconds) since Python's
193 # %f only handles up to 6 digits, but the API may return 7 (nanoseconds).
194 creation_time = re.sub(r"(\.\d{6})\d+", r"\1", creation_time)
195 return datetime.datetime.strptime(creation_time, "%Y-%m-%dT%H:%M:%S.%f%z")

Callers 6

from_jsonMethod · 0.90
from_jsonMethod · 0.90
from_jsonMethod · 0.90

Calls

no outgoing calls