Calendar or duration rule
Month length follows Gregorian calendar rules for the selected year.
February has 29 days only in leap years.
Worked check
February is the useful edge case: it has 28 days in an ordinary year and 29 in a leap year. April, June, September and November have 30; the remaining ordinary months have 31.
Rule: Month length follows Gregorian calendar rules for the selected year. February has 29 days only in leap years. For a final check, distinguish calendar arithmetic from elapsed duration, confirm the intended local date or time zone, and inspect month-end, leap-year or daylight-saving boundaries when they can affect the meaning.
Gregorian month length
February is 29 days in years divisible by 4, except century years unless divisible by 400. Other month lengths are fixed by the Gregorian calendar.