fix tvnz time for nzst/nzdt

This commit is contained in:
Jason 2020-11-26 00:35:32 +00:00
parent 8bb2d174bf
commit 085dd47d13

View File

@ -1,10 +1,16 @@
import pytz import pytz
from datetime import timedelta
import dateutil.parser import dateutil.parser
TZINFOS = { TZINFOS = {
'NZDT': pytz.timezone('Pacific/Auckland'), '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): def unix(date_str, tz=None, tzinfos=TZINFOS):
@ -15,4 +21,4 @@ def unix(date_str, tz=None, tzinfos=TZINFOS):
return int(dt.timestamp()) return int(dt.timestamp())
except: except:
pass pass
return 0 return 0