Skip to content

Commit 7cca5dc

Browse files
committed
Fix UTC timestamps
1 parent 0e00209 commit 7cca5dc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

indexer/src/models.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import os
33
import json
44
import time
5+
import pytz
56
import hashlib
67
import logging
78
import pathlib
@@ -178,7 +179,7 @@ def get_dev_version(self, branch: str) -> Version:
178179
return Version(
179180
version=last_commit.sha[:8],
180181
changelog=changelog,
181-
timestamp=int(last_commit.commit.author.date.timestamp()),
182+
timestamp=int(pytz.utc.localize(last_commit.commit.author.date).timestamp()),
182183
)
183184
except Exception as e:
184185
logging.exception(e)
@@ -194,7 +195,7 @@ def get_release_version(self) -> Version:
194195
return Version(
195196
version=last_release.title,
196197
changelog=last_release.body.split("## 🚀 Changelog", 1)[-1].lstrip(),
197-
timestamp=int(last_release.created_at.timestamp()),
198+
timestamp=int(pytz.utc.localize(last_release.published_at).timestamp()),
198199
)
199200
except StopIteration:
200201
return None

0 commit comments

Comments
 (0)