Leap years in the Gregorian calendar
The orbit of the Earth around the Sun takes a little more than 365 days (precisely 365.2422 days). As a result, some adjustments must be applied to keep the seasons correct. Namely, it is necessary to maintain correctness so that even in many years, decades, and centuries, it will be possible to apply the same rules for individual days and the position of the Sun from a calendar perspective.
Leap years are used periodically to decrease the difference between the calendar year and the Earth’s real rotation and to ensure year-over-year mapping. How do we identify a leap year? Well, if the year value can be divided by four without any remainder, then that year can be considered a leap year. That is true just for the Julian calendar, but the Gregorian calendar applies additional rules that ensure that the number of leap years is lowered. Namely, the year number must be divisible by four, except for the first year of the century (divisible...