<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>todays_mitsui</author_name>
  <author_url>https://blog.hatena.ne.jp/todays_mitsui/</author_url>
  <blog_title>無駄と文化</blog_title>
  <blog_url>https://blog.mudatobunka.org/</blog_url>
  <categories>
    <anon>Python</anon>
  </categories>
  <description>Python で日付計算と言えば datetime モジュールですね。まぁまぁ便利なんですが、標準では 月初 や 月末 を求めることができません。 なのでちょっとしたユーティリティコードとして書いておきました。 N ヶ月後・N ヶ月前 add_month() は N ヶ月後の同日同時間 を求める関数です。同様に sub_month() は N ヶ月前の同日同時間 を求めます。 2月31日 のように計算結果が存在しない日付になってしまう場合は、同月の末日を返します。 本当は datetime.timedelta を使えれば良かったんですが、datetime.timedelta では N ヶ月差を…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.mudatobunka.org%2Fentry%2F2017%2F03%2F28%2F005407&quot; title=&quot;Python で日時計算 ～ 月初とか月末とか N ヵ月前とか - 無駄と文化&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>2017-03-28 00:54:07</published>
  <title>Python で日時計算 ～ 月初とか月末とか N ヵ月前とか</title>
  <type>rich</type>
  <url>https://blog.mudatobunka.org/entry/2017/03/28/005407</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
