<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>mamorums</author_name>
  <author_url>https://blog.hatena.ne.jp/mamorums/</author_url>
  <blog_title>C#, Python, Web開発</blog_title>
  <blog_url>https://web-dev.hatenablog.com/</blog_url>
  <categories>
    <anon>Python</anon>
  </categories>
  <description>yfinanceのデータをダウンロードして、日付と日付の間の日数を求めると、誤差が出ることがありました。 これから、その詳細を記載していきます。 事象・原因 yfinanceでダウンロードしたデータの日時は、タイムゾーン情報が付与されていて、通常時とサマータイム適用時でオフセットの差があります。 タイムゾーン情報の違いが原因で、日付間の日数を算出すると誤差が出ていました。 具体例 以下は「2024-03-07」と「2024-05-24」の日数を算出して出力する例です。 import pandas as pd # 年月日のみ date1 = pd.to_datetime(&quot;2024-03-07&quot;…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fweb-dev.hatenablog.com%2Fentry%2Fpython%2Fyfinance%2Ftz%2Flocalize-none&quot; title=&quot;yfinance タイムゾーン情報とサマータイムについて - C#, Python, Web開発&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2025-09-30 08:20:00</published>
  <title>yfinance タイムゾーン情報とサマータイムについて</title>
  <type>rich</type>
  <url>https://web-dev.hatenablog.com/entry/python/yfinance/tz/localize-none</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
