python determine last day of month from given month and year code example
Example: python datetime last day of month
>>import calendar
>>year, month = 2016, 12
>>calendar.monthrange(year, month)[1]
31
>>import calendar
>>year, month = 2016, 12
>>calendar.monthrange(year, month)[1]
31