Fix datetime parsing
This commit is contained in:
parent
36b9421846
commit
dbf4a78651
|
@ -123,10 +123,11 @@ def last_online_recent(date):
|
||||||
date[1].replace(":", "")
|
date[1].replace(":", "")
|
||||||
date = "+".join(date_split)
|
date = "+".join(date_split)
|
||||||
date_string = "%Y-%m-%dT%H:%M:%S%z"
|
date_string = "%Y-%m-%dT%H:%M:%S%z"
|
||||||
|
now = datetime.now(timezone.utc)
|
||||||
else:
|
else:
|
||||||
date_string = "%Y-%m-%dT%H:%M:%S.%fZ"
|
date_string = "%Y-%m-%dT%H:%M:%S.%fZ"
|
||||||
|
now = datetime.now()
|
||||||
date_parsed = datetime.strptime(date, date_string)
|
date_parsed = datetime.strptime(date, date_string)
|
||||||
now = datetime.now(timezone.utc)
|
|
||||||
sec_ago_date = (now - date_parsed).total_seconds()
|
sec_ago_date = (now - date_parsed).total_seconds()
|
||||||
return sec_ago_date < 172800
|
return sec_ago_date < 172800
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue