How to calculate a Julian date
Count the days from 1 January through the date you want. That count is the 3-digit Julian date. Put the year's last digit in front of it for the 4-digit code, or the last two digits for the military code. The Julian day number uses the equation below.
Notation
- R is the Julian day number.
- x₁ is the year.
- x₂ is the month.
- x₃ is the day.
January and February are counted as months 13 and 14 of the previous year. The core equation uses that adjusted year and month, not the raw calendar month.
Core equation (Gregorian)
a = ⌊(14 − x₂) / 12⌋ y = x₁ + 4800 − a m = x₂ + 12a − 3 R = x₃ + ⌊(153m + 2) / 5⌋ + 365y + ⌊y / 4⌋ − ⌊y / 100⌋ + ⌊y / 400⌋ − 32045
Worked example for Friday, November 20, 2026
x₁ = 2026, x₂ = 11, x₃ = 20 a = 0, y = 6826, m = 8 ⌊(153m + 2) / 5⌋ = 245 365y = 2491490 ⌊y / 4⌋ = 1706, ⌊y / 100⌋ = 68, ⌊y / 400⌋ = 17 R = 2461365
Check the equation with a known date: 1 January 2000 has Julian day number 2451545.
Method
The year, month, and day are read as one Miladi date. The month and year are adjusted, the core equation returns the Julian day number, and the 3-digit, 4-digit, and military codes are then written from the day of the year. A clock time adds the fraction of the day. Change one input at a time to see which code moves.
