formula for date as # day of the gregorian calendar_year (including leap years, excluding leap-seconds)

57 Views Asked by At

large to small could go 2021-Jan-02nd.

Suppose want it in U.S. style, 01/02/'21, where 01/01 = January 1st = day#1 of the year (2021).

01|31

02|28,29

03|31

04|30

05|31

06|30

07|31

08|31

09|30

10|31

11|30

12|31

02 # days, February has 28 on non leap-years; starting starting from 2000: {'01,'02,'03}+4y. 29 on leap day, every fourth year; starting from 2000: {'00}+4y

good so far? How to proceed? Any elegant formula?