Ordinal Dates and Day-of-Year Format
Learn about ordinal date formats that represent dates as day-of-year (1-366). Covers ISO ordinal dates, Julian day numbers, and their use in aviation, science, and military.
Detailed Explanation
Ordinal Dates (Day of Year)
An ordinal date expresses a date as the sequential day number within a year, ranging from 1 (January 1) to 365 or 366 (December 31 in a leap year). This is a compact and useful representation in several specialized fields.
ISO 8601 Ordinal Date
2026-059 # February 28, 2026 (the 59th day)
2026-001 # January 1
2026-365 # December 31
Format: YYYY-DDD where DDD is the zero-padded day of year.
Day-of-Year Table
| Date | Day of Year | Notes |
|---|---|---|
| January 1 | 001 | |
| February 1 | 032 | |
| February 28 | 059 | |
| February 29 | 060 | Leap years only |
| March 1 | 060 or 061 | Depends on leap year |
| July 1 | 182 | Midpoint of the year |
| December 31 | 365 or 366 |
Calculating Day of Year
// JavaScript
const d = new Date(2026, 1, 28);
const start = new Date(d.getFullYear(), 0, 0);
const dayOfYear = Math.floor((d - start) / 86400000); // 59
# Python
from datetime import date
d = date(2026, 2, 28)
day_of_year = d.timetuple().tm_yday # 59
# or with strftime
d.strftime("%j") # "059"
// Go
t := time.Date(2026, 2, 28, 0, 0, 0, 0, time.UTC)
dayOfYear := t.YearDay() // 59
Format Tokens
| Language | Token | Output |
|---|---|---|
| Python | %j |
059 (zero-padded to 3 digits) |
| PHP | z |
58 (0-indexed, no padding) |
| Java | DDD |
059 |
| Ruby | %j |
059 |
Note: PHP's z returns 0-indexed (January 1 = 0), unlike all other languages which use 1-indexed.
Applications
Aviation (ICAO/FAA)
Flight plans use ordinal dates in the format YYDDD:
26059 = February 28, 2026
Military (DTG — Date-Time Group) Military date-time groups sometimes use Julian dates for brevity.
Scientific Data Satellite imagery, weather data, and astronomical observations often use ordinal dates for file naming:
LANDSAT_2026059_B4.tif # Landsat Band 4, day 59 of 2026
Manufacturing Production lot codes often encode the manufacture date as YYDDD:
Lot 26059 = Manufactured on the 59th day of 2026
Use Case
Ordinal dates are used in satellite imagery file naming (NASA, ESA), aviation flight plan coding, military date-time groups, pharmaceutical batch numbering, food product date codes, and scientific data archival systems where compact date representation is needed.