Skip to content

Instantly share code, notes, and snippets.

@kgantsov
Created April 11, 2022 07:23
Show Gist options
  • Save kgantsov/5aa563b5db5d174982704e0c371bed83 to your computer and use it in GitHub Desktop.
Save kgantsov/5aa563b5db5d174982704e0c371bed83 to your computer and use it in GitHub Desktop.
time_from_uuid1.py
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