How it's calculated
days in year = 366 if leap, else 365 (leap: year ÷ 4 and not ÷ 100, unless ÷ 400)
Leap-year rule sets February to 29 vs 28 days and the year length; month lengths follow the Gregorian calendar.
Common questions
How do I know if a year is a leap year?
It is a leap year if divisible by 4, except century years, which must also be divisible by 400. So 2000 was a leap year but 1900 was not.
What is the day of the year?
It counts which numbered day a date falls on, from 1 on January 1 to 365 or 366 on December 31.