Dynamic UTF offset.
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Tue, 17 Dec 2019 20:19:14 +0000 (20:19 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Tue, 17 Dec 2019 20:19:14 +0000 (20:19 +0000)
git-svn-id: http://www.winterrodeln.org/svn/wrpylib/trunk@2862 7aebc617-e5e2-0310-91dc-80fb5f6d2477

wrpylib/wrintermaps.py

index 5620b9b52314bd84d56be3a40a50b49b6fe04f91..57dfcfd1ed8bb80aeb9ed4fd8a8f075c69a7d9fa 100644 (file)
@@ -1,6 +1,6 @@
 import datetime
-import itertools
 import json
+import re
 from sqlalchemy import orm
 from wrpylib.wrorm import Page, WrIntermapsSledrun, WrIntermapsReport, WrIntermapsReportHistory
 
@@ -88,7 +88,7 @@ def update_wrintermapsreport(session, json_content: dict, last_check: datetime.d
         report.status = sledrun_json['status']
         report.last_update = region['lastUpdate']
         report.last_check = last_check
-        report.utc_offset = 1
+        report.utc_offset = int(re.match(r'UTC([-+]\d\d)\d\d', region['timeZone']).group(1))
         session.add(report)
     session.commit()