Skip to content

Commit 0fc5fd9

Browse files
committed
Add timezone to timestamp in user page
1 parent bc76a38 commit 0fc5fd9

File tree

1 file changed

+3
-3
lines changed
  • listenbrainz/webserver/views

1 file changed

+3
-3
lines changed

listenbrainz/webserver/views/user.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from datetime import datetime
1+
from datetime import datetime, timezone
22
from math import ceil
33
from collections import defaultdict
44

@@ -79,9 +79,9 @@ def profile(user_name):
7979

8080
args = {}
8181
if max_ts:
82-
args['to_ts'] = datetime.utcfromtimestamp(max_ts)
82+
args['to_ts'] = datetime.fromtimestamp(max_ts, timezone.utc)
8383
elif min_ts:
84-
args['from_ts'] = datetime.utcfromtimestamp(min_ts)
84+
args['from_ts'] = datetime.fromtimestamp(min_ts, timezone.utc)
8585
data, min_ts_per_user, max_ts_per_user = ts_conn.fetch_listens(
8686
user.to_dict(), limit=LISTENS_PER_PAGE, **args)
8787
min_ts_per_user = int(min_ts_per_user.timestamp())

0 commit comments

Comments
 (0)