mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-11 05:14:07 +00:00
fix timezone handling for timestamps from the database
SQLite is not timezone-aware, so make sure to convert to UTC before inserting any data.
This commit is contained in:
@@ -37,7 +37,10 @@ async def get_status(conn: SearchConnection) -> StatusResult:
|
||||
status.data_updated = await conn.scalar(sql)
|
||||
|
||||
if status.data_updated is not None:
|
||||
status.data_updated = status.data_updated.replace(tzinfo=dt.timezone.utc)
|
||||
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:
|
||||
|
||||
Reference in New Issue
Block a user