Skip to content

Instantly share code, notes, and snippets.

@dtanham
Created May 6, 2014 20:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dtanham/fa730b16631d84585e87 to your computer and use it in GitHub Desktop.
Save dtanham/fa730b16631d84585e87 to your computer and use it in GitHub Desktop.
Last day of month (30, 31, 28, 29)
"""Calculates the end date for any given datetime object"""
import calendar
def last_day(year, month):
return calendar.monthrange(year, month)[1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment