Skip to content

Commit

Permalink
UTC->timezone.utc
Browse files Browse the repository at this point in the history
  • Loading branch information
janosh committed Apr 26, 2024
1 parent 21a8b02 commit 538b170
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions fireworks/core/firework.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import pprint
from collections import defaultdict
from copy import deepcopy
from datetime import UTC, datetime
from datetime import datetime, timezone
from typing import Any, Iterator, NoReturn, Sequence

from monty.io import reverse_readline, zopen
Expand Down Expand Up @@ -579,7 +579,7 @@ def reservedtime_secs(self):
"""
start = self.time_reserved
if start:
end = self.time_start or datetime.now(tz=UTC)
end = self.time_start or datetime.now(tz=timezone.utc)
return (end - start).total_seconds()
return None

Expand Down
4 changes: 2 additions & 2 deletions fireworks/core/rocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import pdb
import shutil
import traceback
from datetime import UTC, datetime
from datetime import datetime, timezone
from threading import Event, Thread, current_thread
from typing import TYPE_CHECKING

Expand Down Expand Up @@ -51,7 +51,7 @@ def do_ping(launchpad: LaunchPad, launch_id: int) -> None:
launchpad.ping_launch(launch_id)
else:
with open("FW_ping.json", "w") as f:
f.write(f'{{"ping_time": "{datetime.now(tz=UTC).isoformat()}"}}')
f.write(f'{{"ping_time": "{datetime.now(tz=timezone.utc).isoformat()}"}}')


def ping_launch(launchpad: LaunchPad, launch_id: int, stop_event: Event, master_thread: Thread) -> None:
Expand Down

0 comments on commit 538b170

Please sign in to comment.