diff --git a/binderhub/events.py b/binderhub/events.py index 02fa730e6..37a6ad957 100644 --- a/binderhub/events.py +++ b/binderhub/events.py @@ -4,7 +4,7 @@ import json import logging -from datetime import datetime +import datetime import jsonschema from jupyterhub.traitlets import Callable @@ -98,8 +98,9 @@ def emit(self, schema_name, version, event): schema = self.schemas[(schema_name, version)] jsonschema.validate(event, schema) + now_utc = datetime.datetime.now(tz=datetime.timezone.utc) capsule = { - "timestamp": datetime.utcnow().isoformat() + "Z", + "timestamp": now_utc.isoformat() + "Z", "schema": schema_name, "version": version, }