2011-01-19から1日間の記事一覧

Python で月末の日付を取得する方法

Python で、指定した月の月末の日付を date オブジェクトで取得する必要があって、実装してみたのでメモしておきます。 from datetime import date from calendar import monthrange def get_last_date(year, month): # monthrange は月の1日の曜日と日数を…