Skip to content

Commit c95512f

Browse files
authored
Fix for pandas-datareader on unixtime in windows
pydata#378
1 parent adb67b2 commit c95512f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pandas_datareader/yahoo/daily.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,14 @@ def url(self):
127127
def _get_params(self, symbol):
128128
# This needed because yahoo returns data shifted by 4 hours ago.
129129
four_hours_in_seconds = 14400
130-
unix_start = int(time.mktime(self.start.timetuple()))
130+
#unix_start = int(time.mktime(self.start.timetuple()))
131+
unix_start = (self.start - datetime.datetime(1970, 1, 1)).total_seconds()
131132
unix_start += four_hours_in_seconds
133+
132134
day_end = self.end.replace(hour=23, minute=59, second=59)
133-
unix_end = int(time.mktime(day_end.timetuple()))
135+
136+
#unix_end = int(time.mktime(day_end.timetuple()))
137+
unix_end = (day_end - datetime.datetime(1970, 1, 1)).total_seconds()
134138
unix_end += four_hours_in_seconds
135139

136140
params = {

0 commit comments

Comments
 (0)