GerevAI / gerev

🧠 AI-powered enterprise search engine 🔎
https://app.klu.so/signup?utm_source=github_gerevai
MIT License
2.71k stars 178 forks source link

Fix timezone parse for non-UTC timezone #96

Closed kebe7jun closed 1 year ago

kebe7jun commented 1 year ago

Fix https://github.com/GerevAI/gerev/issues/95

>>> datetime.datetime.strptime('2017-12-05T15:00:24.972+08:00', '%Y-%m-%dT%H:%M:%S.%f%z')
datetime.datetime(2017, 12, 5, 15, 0, 24, 972000, tzinfo=datetime.timezone(datetime.timedelta(seconds=28800)))
>>> datetime.datetime.strptime('2017-12-05T15:00:24.972Z', '%Y-%m-%dT%H:%M:%S.%f%z')
datetime.datetime(2017, 12, 5, 15, 0, 24, 972000, tzinfo=datetime.timezone.utc)