(creation_time: str)
| 189 | |
| 190 | |
| 191 | def 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") |
no outgoing calls