From df58870e3f1b4b1166950330350bdd39211d15ab Mon Sep 17 00:00:00 2001 From: Emmanuel Ferdman Date: Thu, 17 Apr 2025 11:15:16 -0700 Subject: [PATCH] resolve datetime deprecation warnings Signed-off-by: Emmanuel Ferdman --- src/nominatim_api/v1/format_xml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nominatim_api/v1/format_xml.py b/src/nominatim_api/v1/format_xml.py index b3f0e562..ed6aca0a 100644 --- a/src/nominatim_api/v1/format_xml.py +++ b/src/nominatim_api/v1/format_xml.py @@ -90,7 +90,7 @@ def format_base_xml(results: Union[ReverseResults, SearchResults], result will be output, otherwise a list. """ root = ET.Element(xml_root_tag) - root.set('timestamp', dt.datetime.utcnow().strftime('%a, %d %b %Y %H:%M:%S +00:00')) + root.set('timestamp', dt.datetime.now(dt.timezone.utc).strftime('%a, %d %b %Y %H:%M:%S +00:00')) root.set('attribution', cl.OSM_ATTRIBUTION) for k, v in xml_extra_info.items(): root.set(k, v) -- 2.39.5