mirror of
https://github.com/bspeice/metrik
synced 2024-12-25 23:18:15 -05:00
Use an actual package for localization
This commit is contained in:
parent
79c51c16cc
commit
dc3c57445b
@ -1,8 +1,7 @@
|
||||
from __future__ import print_function
|
||||
|
||||
import csv
|
||||
import pytz
|
||||
from dateutil.tz import tzlocal
|
||||
from tzlocal import get_localzone
|
||||
import requests
|
||||
from collections import namedtuple
|
||||
from dateutil.parser import parse
|
||||
@ -65,8 +64,7 @@ class LiborRateTask(MongoCreateTask):
|
||||
logging.info('Received string for publication time: {}'.format(row['publication']))
|
||||
dt = parse(row['publication'])
|
||||
if dt.tzinfo is None:
|
||||
tzname = tzlocal().tzname
|
||||
tz = pytz.timezone(tzname)
|
||||
tz = get_localzone()
|
||||
dt = tz.localize(dt)
|
||||
logging.info('Parsed datetime: {}'.format(dt))
|
||||
logging.info('Parse timezone: {}'.format(dt.tzinfo))
|
||||
|
@ -3,4 +3,5 @@ luigi>=2.2.0
|
||||
pyquery>=1.2.9
|
||||
requests>=2.9.1
|
||||
pandas>=0.17.1
|
||||
pymongo>=3.2
|
||||
pymongo>=3.2
|
||||
tzlocal>=1.2.2
|
Loading…
Reference in New Issue
Block a user