Conversion between the Julian date and the Gregorian calendar

from Wikipedia, the free encyclopedia

The Julian date counts the days since January 1st, 4713 BC. Chr. (JD = 0) through. This date is based on the proleptic (advanced) Julian calendar , which was introduced later.

The Gregorian calendar was introduced in 1582 to compensate for the deviation of the Julian calendar from the solar year.

Table-controlled conversion

difference Data
0 days 4th October 1582 Jul.
10 days October 5th jul. / October 15, 1582 greg.
10 days February 28th Jul. / March 10th 1700 greg.
11 days February 29th Jul. / March 11th 1700 greg.
11 days March 1st jul. / March 12th 1700 greg.
11 days February 28th Jul. / March 11th 1800 greg.
12 days February 29th Jul. / March 12th 1800 greg.
12 days March 1st jul. / March 13th 1800 greg.
12 days February 28th Jul. / March 12, 1900 greg.
13 days February 29th Jul. / March 13, 1900 greg.
13 days March 1st jul. / March 14, 1900 greg.
13 days February 15th jul. / February 28, 2000 greg.
13 days February 16, Jul. / February 29, 2000 greg.
13 days February 17th Jul. / March 1, 2000 greg.
13 days February 28th Jul. / March 12, 2000 greg.
13 days February 29th Jul. / March 13, 2000 greg.
13 days March 1st jul. / March 14, 2000 greg.
13 days February 28th Jul. / March 13th 2100 greg.
14 days February 29th Jul. / March 14th 2100 greg.
14 days March 1st jul. / March 15, 2100 greg.

In the calendar reform of 1582, ten days were skipped. These ten days make up the difference between the two calendars until February 29th jul. / March 11th 1700 greg. . In the Julian calendar a leap day follows, in the Gregorian 1700 has no leap day, so the difference from March 1st is July. / March 12th 1700 greg. eleven days. In each of the years 1800, 1900, 2100, 2200, 2300, 2500 etc., the interval between the Gregorian and the Julian date increases by a further day. In the 20th as in the 21st century, it is 13 days. On July 8 jul. / July 21, 1969 greg. entered Neil Armstrong became the first man on the moon.

Current day

In this calculation, the day count since the beginning of the year, starting with 0, is called the current day (LT). LT = 0 for January 1st, LT = 364 (normal year) or LT = 365 (leap year) for December 31st .

To convert between the date and the current day, see Calculating the Current Day .

The leap year criterion to be applied is:

Leap years are usually the years divisible by 4. However:
Years divisible by 100 are only leap years if they are divisible by 400. (So, for example, 2000 was a leap year, 1900 was not.)

Present year

In this calculation, the beginning of the Gregorian calendar is brought forward to January 1st of the year 1. This means that the calendar starts at the beginning of a 400-year cycle and the calculation is simplified. The current year (LJ) is the number of years from this starting year. For year 1 , LJ = 0, for year 2 , LJ = 1, and so on. The Julian date of this day is JD0 = 1721426.

Gregorian calendar → Julian date

The current day (LT) is determined from month (M) and day (T), taking into account the leap year criterion (see conversion between Julian date and Julian calendar ).

Then the current year (LJ) is calculated from the year (J):

 LJ = J - 1

To calculate the Julian date, the number of full 400-year cycles (N400) since the start year and the number of full years (R400) in the last, incomplete 400-year cycle are calculated:

 N400 = LJ/400 (ganzzahlig)
 R400 = Rest dieser Division

The number of full 100-year cycles (N100) of the last 400-year cycle and the number of full years (R100) in the last, incomplete 100-year cycle are calculated from R400:

 N100 = R400/100 (ganzzahlig)
 R100 = Rest dieser Division

Then the number of full 4-year cycles (N4) of the last 100-year cycle and the number of full years (N1) in the last, incomplete 4-year cycle are calculated from R100:

 N4 = R100/4 (ganzzahlig)
 N1 = Rest dieser Division

The Julian date is then calculated as follows:

 JD = JD0 + N400*146097 + N100*36524 + N4*1461 + N1*365 + LT

The numbers are the length of the cycles in days. 1461 (3 * 365 + 366) for the 4-year cycle, 36524 (24 * 1461 + 1460) for the 100-year cycle and 146097 (3 * 36524 + 36525) for the 400-year cycle.

Julian date → Gregorian calendar

To calculate a date in the Gregorian calendar with a given Julian date, the number of full 4-year cycles (N400) since the start year and the number of days (R400) of the last, incomplete 400-year cycle are calculated:

 N400 = (JD - JD0)/146097 (ganzzahlig)
 R400 = Rest dieser Division

Next, the number of full 100-year cycles (N100) of the incomplete 400-year cycle and the number of days (R100) of the last, incomplete 100-year cycle are calculated:

 N100 = R400/36524 (ganzzahlig)
 R100 = Rest dieser Division

On the last day of the cycle, the calculation results in N100 = 4 and R100 = 0. In this case, the values ​​must be corrected:

 falls (N100=4) setze N100=3 und R100=36524

Then the number of full 4-year cycles (N4) of the incomplete 100-year cycle is calculated, as well as the number of days (R4) of the last, incomplete 4-year cycle:

 N4 = R100/1461 (ganzzahlig)
 R4 = Rest dieser Division

Finally, the number of full years (N1) of the incomplete 4-year cycle is calculated, as well as the current day (LT) in the last year:

 N1 = R4/365 (ganzzahlig)
 LT = Rest dieser Division

On the last day of the cycle, the calculation results in N1 = 4 and LT = 0. In this case, the values ​​must be corrected:

 falls (N1=4) setze N1=3 und LT=365

The current year LJ results in:

 LJ = 400*N400 + 100*N100 + 4*N4 + N1

The calculation of the year (J) from LJ results from:

 J = LJ + 1

To calculate the month (M) and day (D) from LT, see Conversion between a Julian date and a Julian calendar .

Examples

Gregorian calendar in Julian date

  1.1.2000 GK:   SK  = 0
                 MK  = -1
                 LT  = T + 30*(M-1) + SK + MK
                     = 1 + 30*0 - 1
                     = 0
                 LJ  = J - 1
                     = 1999
                    
                 N400= LJ/400
                     = 4
                  R400= 399   (Rest davon)
                    
                 N100= R400/100
                     = 3
                 R100= 99    (Rest davon)
                    
                 N4  = R100/4
                     = 24
                 N1  = 3     (Rest davon)
                    
                 JD  = JD0 + N400*146097 +                    = 1721426 + 584388 + 109572 + 35064 + 1095 + 0
 --> 2451545 JD
 31.12.1600 GK:  SK  = 1
                 MK  = 3
                 LT  = T + 30*(M-1) + SK + MK
                     = 31 + 30*11 + 1 + 3
                     = 365
                 LJ  = J - 1
                     = 1599
                    
                 N400= LJ/400
                     = 3
                 R400= 399   (Rest davon)
                    
                 N100= R400/100
                     = 3
                 R100= 99    (Rest davon)
                    
                 N4  = R100/4
                     = 24
                 N1  = 3     (Rest davon)
                    
                 JD  = JD0 + N400*146097 + N100*36524 + N4*1461 + N1*365 + LT
                     = 1721426 + 3*146097 + 109572 + 35064 + 1095 + 365
 --> 2305813 JD

Julian date in Gregorian calendar

 2451545 JD:    N400= (JD - JD0)/146097
                    = 730119/146097
                    = 4
                R400= 145731  (Rest davon)
                    
                N100= R400/36524
                    = 3
                R100= 36159  (Rest davon)
                    
                N4  = R100/1461
                    = 24
                R4  = 1095  (Rest davon)
                    
                N1  = R4/365
                    = 3
                LT  = 0   (Rest davon)
                    
                LJ  = 400*N400 + 100*N100 + 4*N4 + N1
                    = 1999
                 J  = LJ + 1
                    = 2000
                 M  = (LT+1)/30 + 1
                    = 1
                SK  = 0
                MK  = -1
                 T  = LT - 30*(M-1) - (SK + MK)
                    = 0 - 30*0 + 1
                    = 1
 --> 1.1.2000 GK
 2305813 JD:    N400= (JD - JD0)/146097
                    = 584387/146097
                    = 3
                R400= 146096  (Rest davon)
                    
                N100= R400/36524
                    = 4
                R100= 0  (Rest davon)
                    
                Korrektur, da N100=4:
                       
                N100= 3
                R100= 36524
                       
                N4  = R100/1461
                    = 24
                R4  = 1460  (Rest davon)
                    
                N1  = R4/365
                    = 4
                LT  = 0   (Rest davon)
                    
                Korrektur, da N1=4:
                       
                N1  = 3
                LT  = 365
                       
                LJ  = 400*N400 + 100*N100 + 4*N4 + N1
                    = 1599
                 J  = LJ + 1
                    = 1600
                 M  = (LT+1)/30 + 1
                    = 13
                       
                Korrektur, da M>12:
                       
                 M  = 12
                SK  = 1
                MK  = 3
                 T  = LT - 30*(M-1) - (SK + MK)
                    = 365 - 30*11 - 4
                    = 31

Julian date → Gregorian calendar: Other possible conversions

Exemplary:

            JD = 2447892,5

Add 0.5 to the JD and insert the integer part for Z and the decimal part (part after the decimal point) for F. Please note if:

Z <2299161 then:

                     a = Z

Z> 2299161 then:

                     a = INT ((Z - 1867216.25) / 36524.25)
                     A = Z + 1 + a - INT (a / 4)
                     B = A + 1524
                     C = INT ((B - 122.1) / 365.25)
                     D = INT (365.25 * C)
                     E = INT ((B - D) / 30.6001)

The day is calculated from:

                     T = B - D - INT (30.6001 * E) + F

The month:

                     M = E - 1 	wenn E < 14
                     M = E - 13    wenn E = 14 oder 15

The year:

                     Y = C - 4716 	wenn m > 2
                     Y = C - 4715  wenn m = 1 oder 2

The following values ​​are obtained:

                    JD = 2447892,5 + 0.5
                       = 2447893
                     Z = 2447893
                     F = 0

Since Z> 2299161 one now gets:

                     a = INT ((2447893 - 1867216.25) / 36524.25)
                       = 15
                     A = 2447893 + 1 + 15 - INT (15 / 4)
                       = 2447906
                     B = 2449430
                     C = 6705
                     D = 2449001
                     E = 14

Result:

                     T = 1 	
                     M = E - 13 	
                       = 1    	denn E = 14
                     Y = C - 4715	
                       = 1990 	denn m = 1

The date we were looking for is January 1, 1990

Determine the day of the week

This is done with the help of the Julian date. First calculate the YD for the given date, add this by 1.5 and divide the result by 7. The remainder of the division ( modulo ) shows the day of the week:

                    0 = Sonntag
                    1 = Montag
                        ...
                    6 = Samstag

Using the example: January 1, 1990

       1. Januar 1990 = 2447892,5
      2447892,5 + 1.5 = 2447894
        2447894 MOD 7 = 1

January 1, 1990 was a Monday .

Existing functions on computer systems

Such conversions for time ranges from a few decades before or after the present (beginning of the 21st century) are carried out by common computer operating systems and runtime environments (e.g. as a function mktime()for C ++ and other programming languages ). On Unix-like systems, the Julian date can be calculated by dividing the "seconds since 01/01/1970 00:00 ( time_t)" by 60 * 60 * 24 = 86400 and adding the constant 2440587.5. Thus, such conversions only have to be implemented in computer programs for further time ranges or on autonomous microcontrollers (if a complete runtime environment is not available on these).

Web links