Use datetime.fromisoformat() to parse dates in tracker import
This would allow preserving original time zone information and also handles negative UTC offset values.
This commit is contained in:
parent
04135b65ca
commit
6b683af18e
|
@ -18,9 +18,7 @@ from todosrht.webhooks import worker
|
|||
our_upstream = get_origin("todo.sr.ht", external=True)
|
||||
|
||||
def _parse_date(date):
|
||||
if "+" in date:
|
||||
date = date[:date.index("+")]
|
||||
date = datetime.strptime(date, "%Y-%m-%dT%H:%M:%S")
|
||||
date = datetime.fromisoformat(date)
|
||||
date = date.astimezone(timezone.utc).replace(tzinfo=None)
|
||||
return date
|
||||
|
||||
|
|
Loading…
Reference in New Issue