Skip to content

Commit

Permalink
UTC -> timezone.utc since UTC is py311+
Browse files Browse the repository at this point in the history
janosh committed Mar 29, 2024
1 parent 1bcd881 commit 227071e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/jobflow/managers/local.py
Original file line number Diff line number Diff line change
@@ -58,7 +58,7 @@ def run_locally(
The responses of the jobs, as a dict of ``{uuid: {index: response}}``.
"""
from collections import defaultdict
from datetime import UTC, datetime
from datetime import datetime, timezone
from pathlib import Path
from random import randint

@@ -152,7 +152,7 @@ def _run_job(job: jobflow.Job, parents):

def _get_job_dir():
if create_folders:
time_now = datetime.now(tz=UTC).strftime(SETTINGS.DIRECTORY_FORMAT)
time_now = datetime.now(tz=timezone.utc).strftime(SETTINGS.DIRECTORY_FORMAT)
job_dir = root_dir / f"job_{time_now}-{randint(10000, 99999)}"
job_dir.mkdir()
return job_dir

0 comments on commit 227071e

Please sign in to comment.