Skip to content

Commit 215bb9c

Browse files
authored
datetime.timezone.utc works for all modern python versions (3.2 -> 3.13+). (#1593)
1 parent 134c654 commit 215bb9c

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

dev_tools/docs/anchor_list.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,10 @@ def write(self):
112112
"""Write the in-memory registry to files"""
113113
if not self._writing_enabled:
114114
return
115+
utcnow = datetime.datetime.now(datetime.timezone.utc).isoformat()
115116
contents = dict(
116117
_metadata=dict(
117-
# datetime=datetime.datetime.now(datetime.UTC).isoformat(),
118-
# the next line is the py3.9 supported way of getting the datetime
119-
# this will become deprecated however in py3.12 for which the
120-
# line above-mentioned is a fix, which however does not work in py3.9
121-
datetime=datetime.datetime.now(datetime.UTC).isoformat(),
118+
datetime=utcnow,
122119
title="NeXus NXDL vocabulary.",
123120
subtitle="Anchors for all NeXus fields, groups, "
124121
"attributes, and links.",

0 commit comments

Comments
 (0)