diff --git a/yfinance/base.py b/yfinance/base.py index b2bed979f..62fcfaa36 100644 --- a/yfinance/base.py +++ b/yfinance/base.py @@ -313,7 +313,9 @@ def history(self, period="1mo", interval="1d", elif params["interval"] == "1h": pass else: - df.index = _pd.to_datetime(df.index.date).tz_localize(tz_exchange) + # If a midnight is during DST transition hour when clocks roll back, + # meaning clock hits midnight twice, then use the 2nd (ambiguous=True) + df.index = _pd.to_datetime(df.index.date).tz_localize(tz_exchange, ambiguous=True) df.index.name = "Date" # duplicates and missing rows cleanup