Days in month could vary based on month and year value. From https://www.timeanddate.com/calendar/months/
Each month has either 28, 30, or 31 days during a common year, which has 365 days. During leap year, which occur nearly every 4 years, we add an extra (intercalary) day, Leap Day, on 29 February, making leap years 366 days long.
The exact function which returns a correct number of days in month is shown below -