Get the number of days in a given month
Takes leap years into account for February.
Full year number
Month (1-12, where 1 = January)
Number of days in the month (28-31), or 0 if month is invalid
daysInMonth(2024, 2) // 29 (leap year)daysInMonth(2023, 2) // 28 (not leap year)daysInMonth(2024, 4) // 30 (April) Copy
daysInMonth(2024, 2) // 29 (leap year)daysInMonth(2023, 2) // 28 (not leap year)daysInMonth(2024, 4) // 30 (April)
Get the number of days in a given month
Takes leap years into account for February.