Generation

generate functionWed, 16 Nov 2022

Get the month as a slice of days

func DaysInMonth(month time.Month, year int) int { // This is equivalent to time.date(year, month+1, 0, 0, 0, 0, 0, time.UTC).Day() return time.Date(year, month+1, 1, 0, 0, 0, 0, time.UTC).AddDate(0, 0, -1).Day() }

Questions about programming?Chat with your personal AI assistant