Skip to content

Commit 430391d

Browse files
prasad-sawantdesaiolivhoenen
authored andcommitted
fixed UTC issue in Python 3.8
1 parent 3587bc7 commit 430391d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

.github/workflows/test_with_pytest.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ jobs:
1111

1212
steps:
1313
- name: Checkout repository
14-
uses: actions/checkout@v2
14+
uses: actions/checkout@v4
1515

1616
- name: Set up Python ${{ matrix.python-version }}
1717

18-
uses: actions/setup-python@v2
18+
uses: actions/setup-python@v4
1919
with:
2020
# until saxonche is available in 3.13
2121
# https://saxonica.plan.io/issues/6561

imas/ids_convert.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,8 @@ def _add_provenance_entry(
533533
# DD version after IMAS-5304
534534
node.reference.resize(len(node.reference) + 1, keep=True)
535535
node.reference[-1].name = source_txt
536-
timestamp = datetime.datetime.now(datetime.UTC).isoformat(timespec="seconds")
536+
utc = getattr(datetime, "UTC", datetime.timezone.utc)
537+
timestamp = datetime.datetime.now(utc).isoformat(timespec="seconds")
537538
node.reference[-1].timestamp = timestamp.replace("+00:00", "Z")
538539
else:
539540
# DD before IMAS-5304 (between 3.34.0 and 3.41.0)

0 commit comments

Comments
 (0)