{"version":"1.0","type":"rich","title":"Python \u3067\u6708\u672b\u306e\u65e5\u4ed8\u3092\u53d6\u5f97\u3059\u308b\u65b9\u6cd5","provider_name":"Hatena Blog","author_name":"griefworker","width":"100%","categories":["Python"],"blog_url":"https://tnakamura.hatenablog.com/","published":"2011-01-19 00:00:00","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftnakamura.hatenablog.com%2Fentry%2F20110119%2Fget_month_last_date\" title=\"Python \u3067\u6708\u672b\u306e\u65e5\u4ed8\u3092\u53d6\u5f97\u3059\u308b\u65b9\u6cd5 - present\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","author_url":"https://blog.hatena.ne.jp/griefworker/","description":"Python \u3067\u3001\u6307\u5b9a\u3057\u305f\u6708\u306e\u6708\u672b\u306e\u65e5\u4ed8\u3092 date \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u53d6\u5f97\u3059\u308b\u5fc5\u8981\u304c\u3042\u3063\u3066\u3001\u5b9f\u88c5\u3057\u3066\u307f\u305f\u306e\u3067\u30e1\u30e2\u3057\u3066\u304a\u304d\u307e\u3059\u3002 from datetime import date from calendar import monthrange def get_last_date(year, month): # monthrange \u306f\u6708\u306e1\u65e5\u306e\u66dc\u65e5\u3068\u65e5\u6570\u3092\u8fd4\u3057\u3066\u304f\u308c\u308b # \u65e5\u6570\u3092 date \u306b\u6e21\u305b\u3070\u6708\u672b\u306e\u65e5\u4ed8\u306e\u3067\u304d\u3042\u304c\u308a youbi, day = monthrange(year, month) last = date(year, month, day) return last first = d\u2026","url":"https://tnakamura.hatenablog.com/entry/20110119/get_month_last_date","height":"190","blog_title":"present","provider_url":"https://hatena.blog","image_url":null}