From 085dd47d136a5d7a3f5a5b5fd905b519d99c49cd Mon Sep 17 00:00:00 2001 From: Jason Date: Thu, 26 Nov 2020 00:35:32 +0000 Subject: [PATCH] fix tvnz time for nzst/nzdt --- apiserver/misc/time.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apiserver/misc/time.py b/apiserver/misc/time.py index e705cb1..0747a78 100644 --- a/apiserver/misc/time.py +++ b/apiserver/misc/time.py @@ -1,10 +1,16 @@ import pytz +from datetime import timedelta import dateutil.parser TZINFOS = { 'NZDT': pytz.timezone('Pacific/Auckland'), - 'NZST': pytz.timezone('Pacific/Auckland') + 'NZST': pytz.timezone('Pacific/Auckland'), +} + +TZINFOS = { + 'NZDT': 13*60*60, + 'NZST': 12*60*60, } def unix(date_str, tz=None, tzinfos=TZINFOS): @@ -15,4 +21,4 @@ def unix(date_str, tz=None, tzinfos=TZINFOS): return int(dt.timestamp()) except: pass - return 0 \ No newline at end of file + return 0