microblog.pub/app/utils/datetime.py

9 lines
201 B
Python
Raw Normal View History

2022-07-11 05:48:38 -05:00
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)