Julian Date
datetime.date.julianShort-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
| Value | As DATE |
|---|---|
| 24-015 | 2024-01-15 |
| 23-365 | 2023-12-31 |
Shape
^\d{2}-\d{3}$| Value | Length | Shape |
|---|---|---|
| 24-015 | 6 | matches |
| 23-365 | 6 | matches |
| 24-01 | 5 | rejected: 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]
Sources
- [1]Ordinal date - Wikipediasecondary source
- [2]Julian day - Wikipediasecondary source
- [3]International standard date and time notationsecondary source
- [4]Date stringsdocumentation
- [5]Cracking the Date Code on Egg Cartons | UNL Food | Nebraskasecondary source
- [6]time — Time access and conversions — Python 3.15.0 documentationdocumentation
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
$ finetype infer -i "24-015" --mode column
→ datetime.date.julian
SELECT ft_infer('24-015');
-- → 'datetime.date.julian'strptime(concat('20', {col}), '%Y-%j')::DATESchema
https://meridian.online/schemas/datetime.date.julian · Frictionless type string
finetype taxonomy datetime.date.julian -o json-schema