An ordinal date is a calendar date typically consisting of a year and a day of the year or ordinal day number (or simply ordinal day or day number), an ordinal number 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 day within a year is part of calculating the ordinal day 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 day 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 day involves counting up all days that have elapsed per the definition: Let O be 0. From , add the length of month to O, taking care of leap year according to the calendar used. Add d to O. 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 day 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 month 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