Last active
May 24, 2016 06:30
-
-
Save brettfreer/6543bbff74647a9bf1cdf82fad748d4f to your computer and use it in GitHub Desktop.
Return last day of month
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
import calendar | |
def last_day_of_month(d): | |
return datetime.datetime(d.year, d.month, calendar.mdays[d.month]).date() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment