microblog.pub/app/utils/datetime.py
2022-07-11 12:48:38 +02:00

8 lines
201 B
Python

from datetime import datetime
from datetime import timezone
from dateutil.parser import isoparse
def parse_isoformat(isodate: str) -> datetime:
return isoparse(isodate).astimezone(timezone.utc)