Skip to content

Commit 369b0ae

Browse files
committed
Fix timezone compare error on osmenrich
1 parent d2040fc commit 369b0ae

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: docker-osmenrich/enrich.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from sys import exit, stderr
2727
from time import sleep
2828
from urllib import request
29+
from datetime import timezone
2930

3031
import xmltodict
3132
import yaml
@@ -319,7 +320,7 @@ def get_osm_enrich_new_data(self, from_osm, from_database):
319320
if osm_id and row:
320321
allow_updated = False
321322
osm_timestamp = self.check_data_on_dict(from_osm, '@timestamp')
322-
osm_datetime = parser.parse(osm_timestamp).replace(tzinfo=None)
323+
osm_datetime = parser.parse(osm_timestamp).replace(tzinfo=timezone.utc)
323324
if not row['changeset_timestamp'] or row['changeset_timestamp'] < osm_datetime:
324325
allow_updated = True
325326
if allow_updated:

0 commit comments

Comments
 (0)