From 136aa6775e9dda44ded5a59aa9205847b6217c8a Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Sat, 13 Aug 2016 09:54:12 -0400 Subject: [PATCH] Correct for DST as well --- metrik/tasks/ice.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/metrik/tasks/ice.py b/metrik/tasks/ice.py index 0cfa733..e848147 100644 --- a/metrik/tasks/ice.py +++ b/metrik/tasks/ice.py @@ -68,10 +68,10 @@ class LiborRateTask(MongoCreateTask): # I'd be interested to know if it's an IP based thing, but the # Travis settings resolve the `local` timezone to UTC so just # manually set New York here to work around that. + logging.warning('Correcting parsed ICE time to America/New_York') tz = pytz.timezone('America/New_York') - dt = tz.localize(dt) - logging.info('Parsed datetime: {}'.format(dt)) - logging.info('Parse timezone: {}'.format(dt.tzinfo)) + dt = tz.localize(dt, is_dst=('EST' in row['publication'])) + dt = dt.replace(year=date.year, month=date.month, day=date.day) globals()['publication'] = dt