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() }

Want to kickstart your project?Use the new AI Studio to create your code