Skip to content

Commit

Permalink
Solve deprecation warning from datetime on UTC
Browse files Browse the repository at this point in the history
  • Loading branch information
berland committed Apr 9, 2024
1 parent 27a9060 commit 7ba3fb5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/integration_tests/scheduler/bin/bjobs.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import argparse
import datetime
import os
from datetime import datetime
from pathlib import Path
from typing import List, Literal, Optional

Expand Down Expand Up @@ -37,7 +37,9 @@ def get_parser() -> argparse.ArgumentParser:
def bjobs_formatter(jobstats: List[Job]) -> str:
string = "JOBID USER STAT QUEUE FROM_HOST EXEC_HOST JOB_NAME SUBMIT_TIME\n"
for job in jobstats:
submit_time = datetime.utcfromtimestamp((job.submit_time))
submit_time = datetime.datetime.fromtimestamp(
job.submit_time, datetime.timezone.utc
)
string += (
f"{str(job.job_id):<5s} {job.user_name:<8s} "
f"{job.job_state:<4s} {job.queue:<8} "
Expand Down

0 comments on commit 7ba3fb5

Please sign in to comment.