isLeapYear(year) to check if a given year is a leap year.monthDays containing the number of days in each month for non-leap years.totalDaysToDate(year, month, day) that calculates the total number of days from year 0 to the given date.
totalDays to 0.(year - 1) * 365.totalDaysToDate.