diff --git a/tagging/taggers.py b/tagging/taggers.py index 0f53827e..06eb8cac 100644 --- a/tagging/taggers.py +++ b/tagging/taggers.py @@ -1,6 +1,6 @@ # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. -from datetime import datetime +import datetime from docker.models.containers import Container @@ -42,7 +42,7 @@ class SHATagger(TaggerInterface): class DateTagger(TaggerInterface): @staticmethod def tag_value(container: Container) -> str: - return datetime.utcnow().strftime("%Y-%m-%d") + return datetime.datetime.now(datetime.UTC).strftime("%Y-%m-%d") class UbuntuVersionTagger(TaggerInterface): diff --git a/tagging/write_manifest.py b/tagging/write_manifest.py index 16a053c5..ca7b0e03 100755 --- a/tagging/write_manifest.py +++ b/tagging/write_manifest.py @@ -17,7 +17,7 @@ from tagging.manifests import ManifestHeader, ManifestInterface LOGGER = logging.getLogger(__name__) # We use a manifest creation timestamp, which happens right after a build -BUILD_TIMESTAMP = datetime.datetime.utcnow().isoformat()[:-7] + "Z" +BUILD_TIMESTAMP = datetime.datetime.now(datetime.UTC).isoformat()[:-13] + "Z" MARKDOWN_LINE_BREAK = "
"