Skip to content

Commit 016efea

Browse files
authored
Fix deprecation for utcfromtimestamp in gameheart plugin
1 parent c6c7817 commit 016efea

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sc2reader/engine/plugins/gameheart.py

Lines changed: 4 additions & 3 deletions
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 sc2reader.utils import Length, get_real_type
33
from sc2reader.objects import Observer, Team
44
from sc2reader.engine.events import PluginExit
@@ -65,8 +65,9 @@ def handleInitGame(self, event, replay):
6565
replay.real_length = Length(
6666
seconds=int(replay.game_length.seconds / GAME_SPEED_FACTOR[replay.speed])
6767
)
68-
replay.start_time = datetime.utcfromtimestamp(
69-
replay.unix_timestamp - replay.real_length.seconds
68+
replay.start_time = datetime.fromtimestamp(
69+
replay.unix_timestamp - replay.real_length.seconds,
70+
timezone.UTC
7071
)
7172

7273
def fix_events(self, replay, start_frame):

0 commit comments

Comments
 (0)