Skip to content

Commit

Permalink
replace the deprecated utcfromtimestamp by Timestamp object
Browse files Browse the repository at this point in the history
  • Loading branch information
amanlai authored Mar 2, 2024
1 parent c2d5683 commit 11764b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion yfinance/scrapers/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def history(self, period="1mo", interval="1d",
quotes = utils.parse_quotes(data["chart"]["result"][0])
# Yahoo bug fix - it often appends latest price even if after end date
if end and not quotes.empty:
endDt = pd.to_datetime(_datetime.datetime.utcfromtimestamp(end))
endDt = pd.Timestamp(end, unit="s")
if quotes.index[quotes.shape[0] - 1] >= endDt:
quotes = quotes.iloc[0:quotes.shape[0] - 1]
except Exception:
Expand Down

0 comments on commit 11764b5

Please sign in to comment.