We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bc76a38 commit 0fc5fd9Copy full SHA for 0fc5fd9
listenbrainz/webserver/views/user.py
@@ -1,4 +1,4 @@
1
-from datetime import datetime
+from datetime import datetime, timezone
2
from math import ceil
3
from collections import defaultdict
4
@@ -79,9 +79,9 @@ def profile(user_name):
79
80
args = {}
81
if max_ts:
82
- args['to_ts'] = datetime.utcfromtimestamp(max_ts)
+ args['to_ts'] = datetime.fromtimestamp(max_ts, timezone.utc)
83
elif min_ts:
84
- args['from_ts'] = datetime.utcfromtimestamp(min_ts)
+ args['from_ts'] = datetime.fromtimestamp(min_ts, timezone.utc)
85
data, min_ts_per_user, max_ts_per_user = ts_conn.fetch_listens(
86
user.to_dict(), limit=LISTENS_PER_PAGE, **args)
87
min_ts_per_user = int(min_ts_per_user.timestamp())
0 commit comments