fbpx
Wikipedia

Ordinal date

An ordinal date is a calendar date typically consisting of a year and an ordinal number, ranging between 1 and 366 (starting on January 1), representing the multiples of a day, called day of the year or ordinal day number (also known as ordinal day or day number). The two parts of the date can be formatted as "YYYY-DDD" to comply with the ISO 8601 ordinal date format. The year may sometimes be omitted, if it is implied by the context; the day may be generalized from integers to include a decimal part representing a fraction of a day.

Today's date (UTC) expressed according to ISO 8601 [refresh]
Date2024-05-13
Ordinal date2024-134
Mission control center's board with time data, displaying universal time with ordinal date (without year) prepended, on 22nd October 2013 (i.e. 2013-295)

Nomenclature edit

Ordinal date is the preferred name for what was formerly called the "Julian date" or JD, or JDATE, 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 JDN, which was in prior use and which remains ubiquitous in astronomical and some historical calculations.

Calculation edit

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 O are presented. The inputs taken are integers y, m and d, for the year, month, and day numbers of the Gregorian or Julian calendar date.

Trivial methods edit

The most trivial method of calculating the ordinal day involves counting up all days that have elapsed per the definition:

  1. Let O be 0.
  2. From i = 1 .. m - 1, add the length of month i to O, taking care of leap year according to the calendar used.
  3. Add d to O.

Similarly trivial is the use of a lookup table, such as the one referenced.[1]

Zeller-like edit

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 m is changed to m + 12 if m ≤ 2. It can be shown (see below) that for a month-number m, the total days of the preceding months is equal to ⌊(153 * (m − 3) + 2) / 5⌋. As a result, the March 1-based ordinal day number is OMar = ⌊(153 × (m − 3) + 2) / 5⌋ + d.

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 153/5 is 30.6, the sequence oscillates in the desired pattern with the desired period 5.

To go from the March 1 based ordinal day to a January 1 based ordinal day:

  • For m ≤ 12 (March through December), O = OMar + 59 + isLeap(y) , where isLeap is a function returning 0 or 1 depending whether the input is a leap year.
  • For January and February, two methods can be used:
    1. The trivial method is to skip the calculation of OMar and go straight for O = d for January and O = d + 31 for February.
    2. The less redundant method is to use O = OMar − 306, where 306 is the number of dates in March through December. This makes use of the fact that the formula correctly gives a month-length of 31 for January.

"Doomsday" properties:

With   and   gives

 

giving consecutive differences of 63 (9 weeks) for n = 2, 3, 4, 5, and 6, i.e., between 4/4, 6/6, 8/8, 10/10, and 12/12.

  and   gives

 

and with m and d interchanged

 

giving a difference of 119 (17 weeks) for n = 2 (difference between 5/9 and 9/5), and also for n = 3 (difference between 7/11 and 11/7).

Table edit

To the day of 13
Jan
14
Feb
3
Mar
4
Apr
5
May
6
Jun
7
Jul
8
Aug
9
Sep
10
Oct
11
Nov
12
Dec
i
Add 0 31 59 90 120 151 181 212 243 273 304 334 3
Leap years 0 31 60 91 121 152 182 213 244 274 305 335 2
Algorithm  

For example, the ordinal date of April 15 is 90 + 15 = 105 in a common year, and 91 + 15 = 106 in a leap year.

Month–day edit

The number of the month and date is given by

 
 

the term   can also be replaced by   with   the ordinal date.

  • Day 100 of a common year:
 
 
April 10.
  • Day 200 of a common year:
 
 
July 19.
  • Day 300 of a leap year:
 
 
November - 5 = October 26 (31 - 5).

Helper conversion table edit

ord.
date
common
year
leap
year
001 01 Jan
010 10 Jan
020 20 Jan
030 30 Jan
032 01 Feb
040 09 Feb
050 19 Feb
060 01 Mar 29 Feb
061 02 Mar 01 Mar
070 11 Mar 10 Mar
080 21 Mar 20 Mar
090 31 Mar 30 Mar
091 01 Apr 31 Mar
092 02 Apr 01 Apr
100 10 Apr 09 Apr
ord.
date
comm.
year
leap
year
110 20 Apr 19 Apr
120 30 Apr 29 Apr
121 01 May 30 Apr
122 02 May 01 May
130 10 May 09 May
140 20 May 19 May
150 30 May 29 May
152 01 Jun 31 May
153 02 Jun 01 Jun
160 09 Jun 08 Jun
170 19 Jun 18 Jun
180 29 Jun 28 Jun
182 01 Jul 30 Jun
183 02 Jul 01 Jul
190 09 Jul 08 Jul
ord.
date
comm.
year
leap
year
200 19 Jul 18 Jul
210 29 Jul 28 Jul
213 01 Aug 31 Jul
214 02 Aug 01 Aug
220 08 Aug 07 Aug
230 18 Aug 17 Aug
240 28 Aug 27 Aug
244 01 Sep 31 Aug
245 02 Sep 01 Sep
250 07 Sep 06 Sep
260 17 Sep 16 Sep
270 27 Sep 26 Sep
274 01 Oct 30 Sep
275 02 Oct 01 Oct
280 07 Oct 06 Oct
ord.
date
comm.
year
leap
year
290 17 Oct 16 Oct
300 27 Oct 26 Oct
305 01 Nov 31 Oct
306 02 Nov 01 Nov
310 06 Nov 05 Nov
320 16 Nov 15 Nov
330 26 Nov 25 Nov
335 01 Dec 30 Nov
336 02 Dec 01 Dec
340 06 Dec 05 Dec
350 16 Dec 15 Dec
360 26 Dec 25 Dec
365 31 Dec 30 Dec
366 31 Dec

See also edit

References edit

  1. ^ "Table of ordinal day number for various calendar dates". Retrieved 2021-04-08.

ordinal, date, this, article, includes, list, references, related, reading, external, links, sources, remain, unclear, because, lacks, inline, citations, please, help, improve, this, article, introducing, more, precise, citations, july, 2019, learn, when, remo. This article includes a list of references related reading or external links but its sources remain unclear because it lacks inline citations Please help improve this article by introducing more precise citations July 2019 Learn how and when to remove this message An ordinal date is a calendar date typically consisting of a year and an ordinal number ranging between 1 and 366 starting on January 1 representing the multiples of a day called day of the year or ordinal day number also known as ordinal day or day number The two parts of the date can be formatted as YYYY DDD to comply with the ISO 8601 ordinal date format The year may sometimes be omitted if it is implied by the context the day may be generalized from integers to include a decimal part representing a fraction of a day Today s date UTC expressed according to ISO 8601 refresh Date2024 05 13Ordinal date2024 134 Mission control center s board with time data displaying universal time with ordinal date without year prepended on 22nd October 2013 i e 2013 295 Contents 1 Nomenclature 2 Calculation 2 1 Trivial methods 2 2 Zeller like 3 Table 4 Month day 5 Helper conversion table 6 See also 7 ReferencesNomenclature editOrdinal date is the preferred name for what was formerly called the Julian date or JD or JDATE 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 JDN which was in prior use and which remains ubiquitous in astronomical and some historical calculations Calculation editThis section possibly contains original research Please improve it by verifying the claims made and adding inline citations Statements consisting only of original research should be removed August 2019 Learn how and when to remove this message 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 O are presented The inputs taken are integers y m and d for the year month and day numbers of the Gregorian or Julian calendar date Trivial methods edit 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 i 1 m 1 add the length of month i 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 1 Zeller like edit 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 m is changed to m 12 if m 2 It can be shown see below that for a month number m the total days of the preceding months is equal to 153 m 3 2 5 As a result the March 1 based ordinal day number is OMar 153 m 3 2 5 d 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 153 5 is 30 6 the sequence oscillates in the desired pattern with the desired period 5 To go from the March 1 based ordinal day to a January 1 based ordinal day For m 12 March through December O OMar 59 isLeap y where isLeap is a function returning 0 or 1 depending whether the input is a leap year For January and February two methods can be used The trivial method is to skip the calculation of OMar and go straight for O d for January and O d 31 for February The less redundant method is to use O OMar 306 where 306 is the number of dates in March through December This makes use of the fact that the formula correctly gives a month length of 31 for January Doomsday properties With m 2 n displaystyle m 2n nbsp and d m displaystyle d m nbsp gives O 63 2 n 91 4 displaystyle O left lfloor 63 2n 91 4 right rfloor nbsp giving consecutive differences of 63 9 weeks for n 2 3 4 5 and 6 i e between 4 4 6 6 8 8 10 10 and 12 12 m 2 n 1 displaystyle m 2n 1 nbsp and d m 4 displaystyle d m 4 nbsp gives O 63 2 n 56 0 2 displaystyle O left lfloor 63 2n 56 0 2 right rfloor nbsp and with m and d interchanged O 63 2 n 56 119 0 4 displaystyle O left lfloor 63 2n 56 119 0 4 right rfloor nbsp giving a difference of 119 17 weeks for n 2 difference between 5 9 and 9 5 and also for n 3 difference between 7 11 and 11 7 Table editTo the day of 13Jan 14Feb 3Mar 4Apr 5May 6Jun 7Jul 8Aug 9Sep 10Oct 11Nov 12Dec i Add 0 31 59 90 120 151 181 212 243 273 304 334 3 Leap years 0 31 60 91 121 152 182 213 244 274 305 335 2 Algorithm 30 m 1 0 6 m 1 i displaystyle 30 m 1 left lfloor 0 6 m 1 right rfloor i nbsp For example the ordinal date of April 15 is 90 15 105 in a common year and 91 15 106 in a leap year Month day editThis section possibly contains original research Please improve it by verifying the claims made and adding inline citations Statements consisting only of original research should be removed August 2019 Learn how and when to remove this message The number of the month and date is given by m o d 30 1 displaystyle m left lfloor od 30 right rfloor 1 nbsp d mod o d 30 i 0 6 m 1 displaystyle d bmod od 30 i left lfloor 0 6 m 1 right rfloor nbsp the term mod o d 30 displaystyle bmod od 30 nbsp can also be replaced by o d 30 m 1 displaystyle od 30 m 1 nbsp with o d displaystyle od nbsp the ordinal date Day 100 of a common year m 100 30 1 4 displaystyle m left lfloor 100 30 right rfloor 1 4 nbsp d mod 100 30 3 0 6 4 1 10 3 3 10 displaystyle d bmod 100 30 3 left lfloor 0 6 4 1 right rfloor 10 3 3 10 nbsp dd April 10 Day 200 of a common year m 200 30 1 7 displaystyle m left lfloor 200 30 right rfloor 1 7 nbsp d mod 200 30 3 0 6 7 1 20 3 4 19 displaystyle d bmod 200 30 3 left lfloor 0 6 7 1 right rfloor 20 3 4 19 nbsp dd July 19 Day 300 of a leap year m 300 30 1 11 displaystyle m left lfloor 300 30 right rfloor 1 11 nbsp d mod 300 30 2 0 6 11 1 0 2 7 5 displaystyle d bmod 300 30 2 left lfloor 0 6 11 1 right rfloor 0 2 7 5 nbsp dd November 5 October 26 31 5 Helper conversion table editord date common year leap year 001 0 1 Jan 010 10 Jan 020 20 Jan 030 30 Jan 032 0 1 Feb 040 0 9 Feb 050 19 Feb 060 0 1 Mar 29 Feb 061 0 2 Mar 0 1 Mar 070 11 Mar 10 Mar 080 21 Mar 20 Mar 090 31 Mar 30 Mar 091 0 1 Apr 31 Mar 092 0 2 Apr 0 1 Apr 100 10 Apr 0 9 Apr ord date comm year leap year 110 20 Apr 19 Apr 120 30 Apr 29 Apr 121 0 1 May 30 Apr 122 0 2 May 0 1 May 130 10 May 0 9 May 140 20 May 19 May 150 30 May 29 May 152 0 1 Jun 31 May 153 0 2 Jun 0 1 Jun 160 0 9 Jun 0 8 Jun 170 19 Jun 18 Jun 180 29 Jun 28 Jun 182 0 1 Jul 30 Jun 183 0 2 Jul 0 1 Jul 190 0 9 Jul 0 8 Jul ord date comm year leap year 200 19 Jul 18 Jul 210 29 Jul 28 Jul 213 0 1 Aug 31 Jul 214 0 2 Aug 0 1 Aug 220 0 8 Aug 0 7 Aug 230 18 Aug 17 Aug 240 28 Aug 27 Aug 244 0 1 Sep 31 Aug 245 0 2 Sep 0 1 Sep 250 0 7 Sep 0 6 Sep 260 17 Sep 16 Sep 270 27 Sep 26 Sep 274 0 1 Oct 30 Sep 275 0 2 Oct 0 1 Oct 280 0 7 Oct 0 6 Oct ord date comm year leap year 290 17 Oct 16 Oct 300 27 Oct 26 Oct 305 0 1 Nov 31 Oct 306 0 2 Nov 0 1 Nov 310 0 6 Nov 0 5 Nov 320 16 Nov 15 Nov 330 26 Nov 25 Nov 335 0 1 Dec 30 Nov 336 0 2 Dec 0 1 Dec 340 0 6 Dec 0 5 Dec 350 16 Dec 15 Dec 360 26 Dec 25 Dec 365 31 Dec 30 Dec 366 31 DecSee also editJulian day Zeller s congruence ISO week dateReferences edit Table of ordinal day number for various calendar dates Retrieved 2021 04 08 Retrieved from https en wikipedia org w index php title Ordinal date amp oldid 1215841019, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.