Ordinal date

An ordinal date is a calendar date typically consisting of a "year" and a "day of the year" ranging between 1 and 366 (starting on January 1), though year may sometimes be omitted. The two numbers can be formatted as YYYY-DDD to comply with the ISO 8601 ordinal date format.
Nomenclature.
"Ordinal date" is the preferred name for what was formerly called the "Julian date" or , or , which still seen in old programming languages and spreadsheet software. The older names are deprecated because they are easily confused with the earlier dating system called "Julian day number" or , which was in prior use and which remains ubiquitous in astronomical and some historical calculations.
Calculation.
Computation of the ordinal date within a year is part of calculating the ordinal date throughout the years from a reference date, such as the Julian date. It is also part of calculating the day of the week, though for this purpose modulo 7 simplifications can be made.
In the following text, several algorithms for calculating the ordinal date is presented. The inputs taken are integers , and , for the year, month, and day numbers of the Gregorian or Julian calendar date.
Trivial methods.
The most trivial method of calculating the ordinal date involves counting up all days that have elapsed per the definition:
Similarly trivial is the use of a lookup table, such as the one referenced.
Zeller-like.
The table of month lengths can be replaced following the method of encoding the month-length variation in Zeller's congruence. As in Zeller, the is changed to if . It can be shown (see below) that for a month-number , the total days of the preceding months is equal to . As a result, the March 1-based ordinal date number is .
The formula reflects the fact that any five consecutive months in the range March–January have a total length of 153 days, due to a fixed pattern 31–30–31–30–31 repeating itself twice. This is similar to encoding of the mohth offset (which would be the same sequence modulo 7) in Zeller's congruence. As is 30.6, the sequence oscillates in the desired pattern with the desired period 5. 
To go from the March 1 based ordinal date to a January 1 based ordinal date:
"Doomsday" properties:
For formula_1 and formula_2 we get
giving consecutive differences of 63 (9 weeks) for 3, 4, 5, and 6, i.e., between 4/4, 6/6, 8/8, 10/10, and 12/12.
For formula_4 and formula_5 we get
and with "m" and "d" interchanged
giving a difference of 119 (17 weeks) for (difference between 5/9 and 9/5), and also for (difference between 7/11 and 11/7).
Table.
For example, the ordinal date of April 15 is in a common year, and in a leap year.
Month–day.
The number of the month and date is given by
the term formula_10 can also be replaced by formula_11 with formula_12 the ordinal date.