From cdbafc534aad9ab8ed366c5d8546bea475dc5acb Mon Sep 17 00:00:00 2001 From: Eddie Hebert Date: Sun, 20 Oct 2013 08:00:17 -0400 Subject: [PATCH] BUG: Fix mismatch of stored benchmark timestamps. Normalize the date, so that there is not an EST/EDT and UTC mismatch. --- zipline/data/benchmarks.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zipline/data/benchmarks.py b/zipline/data/benchmarks.py index 091346c7..5a252637 100644 --- a/zipline/data/benchmarks.py +++ b/zipline/data/benchmarks.py @@ -21,6 +21,7 @@ import csv from functools import partial import requests +import pandas as pd from . loader_utils import ( date_conversion, @@ -126,7 +127,8 @@ def get_benchmark_returns(symbol, start_date=None, end_date=None): else: prev_close = data_points[i - 1]['close'] returns = (data_point['close'] - prev_close) / prev_close - daily_return = DailyReturn(date=data_point['date'], returns=returns) + date = pd.tseries.tools.normalize_date(data_point['date']) + daily_return = DailyReturn(date=date, returns=returns) benchmark_returns.append(daily_return) return benchmark_returns