Merge pull request #285 from fndax/patch-2
[Tweets] Fix tweet age calc for TZ!=UTC
This commit is contained in:
commit
74da824e53
1 changed files with 1 additions and 1 deletions
|
@ -2,7 +2,7 @@ import datetime, html, time
|
|||
from src import utils
|
||||
|
||||
def _timestamp(dt):
|
||||
seconds_since = time.time()-dt.timestamp()
|
||||
seconds_since = time.time()-dt.replace(tzinfo=datetime.timezone.utc).timestamp()
|
||||
timestamp = utils.datetime.format.to_pretty_since(
|
||||
seconds_since, max_units=2)
|
||||
return "%s ago" % timestamp
|
||||
|
|
Loading…
Reference in a new issue