X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/16b6484c650eef161e64153f748643ca61553753..df15f13c628a3e15dee4bcad44e97b2cacb40b9f:/nominatim/api/status.py?ds=sidebyside diff --git a/nominatim/api/status.py b/nominatim/api/status.py index 61e36cc3..1069184c 100644 --- a/nominatim/api/status.py +++ b/nominatim/api/status.py @@ -5,7 +5,7 @@ # Copyright (C) 2023 by the Nominatim developer community. # For a full list of authors see the git log. """ -Classes and function releated to status call. +Classes and function related to status call. """ from typing import Optional import datetime as dt @@ -36,6 +36,12 @@ async def get_status(conn: SearchConnection) -> StatusResult: sql = sa.select(conn.t.import_status.c.lastimportdate).limit(1) status.data_updated = await conn.scalar(sql) + if status.data_updated is not None: + if status.data_updated.tzinfo is None: + status.data_updated = status.data_updated.replace(tzinfo=dt.timezone.utc) + else: + status.data_updated = status.data_updated.astimezone(dt.timezone.utc) + # Database version try: verstr = await conn.get_property('database_version')