Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pandas_datareader/yahoo/daily.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import json
import re
import time
import datetime

from pandas import DataFrame, isnull, notnull, to_datetime

Expand Down Expand Up @@ -127,7 +128,8 @@ def url(self):
def _get_params(self, symbol):
# This needed because yahoo returns data shifted by 4 hours ago.
four_hours_in_seconds = 14400
unix_start = int(time.mktime(self.start.timetuple()))
unix_zero = datetime.datetime(1970, 1, 1, 8)
unix_start = int((self.start - unix_zero).total_seconds())
unix_start += four_hours_in_seconds
day_end = self.end.replace(hour=23, minute=59, second=59)
unix_end = int(time.mktime(day_end.timetuple()))
Expand Down
4 changes: 3 additions & 1 deletion pandas_datareader/yahoo/fx.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
import time
import datetime
import warnings

from pandas import DataFrame, Series, concat, to_datetime
Expand Down Expand Up @@ -39,7 +40,8 @@ class YahooFXReader(YahooDailyReader):
"""

def _get_params(self, symbol):
unix_start = int(time.mktime(self.start.timetuple()))
unix_zero = datetime.datetime(1970, 1, 1, 8)
unix_start = int((self.start - unix_zero).total_seconds())
day_end = self.end.replace(hour=23, minute=59, second=59)
unix_end = int(time.mktime(day_end.timetuple()))

Expand Down