forked from tanner/qotnews
fix tvnz time for nzst/nzdt
This commit is contained in:
parent
8bb2d174bf
commit
085dd47d13
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user