Julian Date Converter: Julian Day, Day of Year and YYDDD Codes
By FindMySum · Last reviewed
This Julian date converter handles all three things people mean by a "Julian date". It turns a calendar date and time into the astronomical Julian Day (JD) and Modified Julian Date (MJD); it gives the day of the year and the YYDDD and YYYYDDD date codes used on food packaging, in the military and on mainframe systems; and it shows the same day in the Julian and Gregorian calendars. It also works backwards, from a Julian Day number or a date code to the date.
Worked example: noon on 1 January 2000
- Rearrange the date. January and February count as months 13 and 14 of the previous year, so Y = 1999 and M = 13. The day with the time is D = 1 + 12/24 = 1.5.
- Gregorian correction. A = ⌊1999/100⌋ = 19 and B = 2 − 19 + ⌊19/4⌋ = −13.
- Julian Day. ⌊365.25 × (1999 + 4716)⌋ + ⌊30.6001 × 14⌋ + 1.5 − 13 − 1524.5 = 2,452,653 + 428 + 1.5 − 13 − 1524.5 = 2,451,545.0.
- Other forms. MJD = 2,451,545.0 − 2,400,000.5 = 51,544.5. It is day 1 of a 366-day year, so the YYDDD code is 00001, and the date was a Saturday.
The page opens on today's date at noon Universal Time, so the first numbers you see are today's.
The astronomical Julian Day
Astronomers need a single continuous count of days that doesn't reset each month or year and doesn't care which calendar a record used. The Julian Day number does that: it counts days from noon Universal Time on 1 January 4713 BC in the Julian calendar, a starting point early enough that every historical observation has a positive number. The fraction after the decimal point is the time of day from noon, so .0 is noon and .5 is midnight.
The algorithm here is the one Jean Meeus published in Astronomical Algorithms, chapter 7, the standard reference for amateur and professional astronomers. It gives the same numbers as the US Naval Observatory's converter, and it works back from a Julian Day to the date and time. Because the count is continuous, the difference between two Julian Days is the exact number of days between them, which is how astronomers time eclipses, variable stars and spacecraft.
The Modified Julian Date subtracts 2,400,000.5. It starts at midnight, which suits civil timekeeping, and keeps numbers to five digits for the next century; it is common in satellite and geodesy data.
Day of the year and YYDDD codes
Outside astronomy, "Julian date" usually means the day of the year. 1 January is day 1, 31 December is day 365, or 366 in a leap year. ISO 8601 calls this an ordinal date and writes it 2026-315.
Manufacturers print it as a compact code on cans, eggs and medicines: two digits for the year and three for the day, so 26315 is 11 November 2026. The US military and many mainframe systems use the same format, sometimes with a four-digit year (2026315) or just the last digit of the year. Enter a five- or seven-digit code to turn it back into a date; two-digit years are read as 2000 to 2099.
Julian and Gregorian calendars
The Julian calendar, introduced by Julius Caesar, has a leap year every four years. Its average year of 365.25 days is about 11 minutes longer than the solar year, so by the 16th century the spring equinox had drifted ten days early. Pope Gregory XIII's reform dropped ten days, so Thursday 4 October 1582 was followed by Friday 15 October 1582, and changed the rule so century years are leap years only when divisible by 400.
Astronomers, following Meeus, read dates before 15 October 1582 in the Julian calendar and later dates in the Gregorian. You can change that in the advanced options and read every date in one calendar instead. The calculator always shows the same day in the other calendar too: the two are now 13 days apart.
Time zones
Julian Days are defined in Universal Time. Enter the time in UTC; in Toronto, for example, add five hours in winter (four in summer) to local time. If you only care about the day of the year or the date code, the time doesn't matter.
More questions
Who invented the Julian Day count?
The French scholar Joseph Scaliger proposed the Julian Period in 1583, a 7,980-year cycle combining three older calendar cycles, all of which started together in 4713 BC. In the 19th century the astronomer John Herschel turned it into a simple day count for astronomy. It is named after Scaliger's father, Julius, not after Julius Caesar.
Is the Julian date code the same as the Julian calendar?
No. The YYDDD code just counts days within an ordinary Gregorian year, and it borrowed the word Julian loosely from the astronomers' day count. The Julian calendar is the calendar Julius Caesar introduced in 46 BC, still used by some Orthodox churches to date religious holidays.
Why does the calculator show year −584 instead of 585 BC?
Astronomers count years with a year 0, so arithmetic works across the BC/AD boundary: year 0 is 1 BC, year −1 is 2 BC, and year −584 is 585 BC. Historians have no year 0 and go straight from 1 BC to AD 1.
When did countries switch to the Gregorian calendar?
Catholic countries such as Spain, Portugal, Italy and Poland switched in October 1582. Britain and its colonies, including what became Canada and the United States, switched in September 1752, dropping 11 days. Russia changed in 1918 and Greece in 1923. A historical date needs the calendar in use at that place and time.
How do spreadsheets store dates?
As serial day numbers, much like a Julian Day with a different starting point. In Excel for Windows day 1 is 1 January 1900, so the serial number equals JD − 2,415,018.5 for dates after February 1900. Unix systems count seconds since 1 January 1970, which is JD 2,440,587.5.
Sources
This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.