diff options
| author | Yuval Adam <yuval@y3xz.com> | 2015-11-08 13:57:24 +0200 |
|---|---|---|
| committer | Yuval Adam <yuval@y3xz.com> | 2015-11-08 13:57:24 +0200 |
| commit | 343b05af04557aaaa68a627ad1bd8cd990aa6b4e (patch) | |
| tree | 88754e572f30683a0f51d7c2944a0cf57c661211 /geshem.py | |
| parent | 740935e8936df84a73f89eb5512355584e10fe11 (diff) | |
Fix UTC->IL timestamps
Diffstat (limited to 'geshem.py')
| -rw-r--r-- | geshem.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -5,6 +5,7 @@ from datetime import datetime from flask import Flask, render_template from os import environ from pathlib import Path +from pytz import utc, timezone from redis.exceptions import ConnectionError MAPS_JSON = 'http://map.govmap.gov.il/rainradar/radar.json' @@ -34,7 +35,7 @@ def home(): try: latests = redis.pipeline().get('latest_140').get('latest_280').execute() latest_140, latest_280 = map(lambda x: x.decode(), latests) - ts = datetime.strptime(latest_280, '%Y%m%d_%H%M%S') + ts = utc.localize(datetime.strptime(latest_280, '%Y%m%d_%H%M%S')).astimezone(timezone('Asia/Jerusalem')) except ConnectionError: latest_140, latest_280 = 'dev', 'dev' ts = datetime.now() |
