Created
April 11, 2022 07:23
-
-
Save kgantsov/5aa563b5db5d174982704e0c371bed83 to your computer and use it in GitHub Desktop.
time_from_uuid1.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
from datetime import timedelta | |
from uuid import UUID | |
def time_from_uuid1(u: str) -> datetime: | |
return datetime(1582, 10, 15) + timedelta(microseconds=UUID(u).time // 10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment