MeridianMERIDIAN

Julian Date

datetime.date.julian

Short-form Julian date with 2-digit year and 3-digit day-of-year. Common in manufacturing, logistics, and food expiration dates.

Worked samples

DuckDB 1.5.5 · finetype 0.6.64

ValueAs DATE
24-0152024-01-15
23-3652023-12-31

Shape

Pattern
^\d{2}-\d{3}$
ValueLengthShape
24-0156matches
23-3656matches
24-015rejected: one character short

Background

Origin

Ordinal date is the preferred name for what was formerly called the "Julian date".[1] The astronomical Julian day number is based on the Julian period proposed by Joseph Scaliger in 1583.[2]

Outside astronomy, the term Julian date may refer to the day-of-year number in the Gregorian calendar, especially in computer programming, the military and the food industry.[2] Wikipedia notes that the terms "ordinal date" or "day-of-year" are preferred because "Julian date" can mean several different things.[2]

Markus Kuhn's summary of ISO 8601 gives 1995-035 or 1995035 as the standard notation for day 035 of 1995, which is 1995-02-04.[3]

Use

IBM's Db2 for i documentation lists a Julian date format, *JUL, written yy/ddd, with the example 87/285.[4] Db2 for i also recognises an unformatted Julian date written yyyyddd, with the example 1987285.[4] In Db2 for i, the separators for two-digit year formats are controlled by the date separator (DATSEP) parameter.[4] If a file of yy-ddd values comes from an IBM midrange system, it is worth asking whether it is the *JUL format with a hyphen set as its separator. (Meridian's view)

The University of Nebraska–Lincoln's food pages explain that the three-digit pack date on an egg carton counts the days of the year, starting with January 1 as 001.[5]

Python's time module documents that two-digit years parsed with %y follow the POSIX and ISO C rule: values 69–99 map to 1969–1999, and values 0–68 map to 2000–2068.[6]

Detection notes

No direct strptime support for 2-digit year + day-of-year. Transform prepends '20' to get 4-digit year, then parses with %Y-%j.

Use it

CLI · DuckDB
$ finetype infer -i "24-015" --mode column
→ datetime.date.julian

SELECT ft_infer('24-015');
-- → 'datetime.date.julian'
Cast expression
strptime(concat('20', {col}), '%Y-%j')::DATE

Schema

https://meridian.online/schemas/datetime.date.julian · Frictionless type string

finetype taxonomy datetime.date.julian -o json-schema

Type Registry