diff --git a/fireworks/core/firework.py b/fireworks/core/firework.py index 8126b679d..7ab607751 100644 --- a/fireworks/core/firework.py +++ b/fireworks/core/firework.py @@ -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 @@ -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 diff --git a/fireworks/core/rocket.py b/fireworks/core/rocket.py index 0de71483e..34975398d 100644 --- a/fireworks/core/rocket.py +++ b/fireworks/core/rocket.py @@ -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 @@ -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: