MeridianMERIDIAN

Short Date (Month-Day-Year, 2-digit year)

datetime.date.short_mdy

Two-digit year, month-first (US ordering). Dash-separated.

Operations on this type: Parse a date or time

Try a value

Short Date (Month-Day-Year, 2-digit year)'s rule accepts it.

Reads it as 2024-03-04

Use it

Shell
finetype infer -i '01-15-24' --mode column
# → datetime.date.short_mdy
DuckDB
SELECT ft_infer('01-15-24');
-- → 'datetime.date.short_mdy'
Cast template: {col} is your column
strptime({col}, '%m-%d-%y')::DATE
-- Format: %m-%d-%y

How finetype reads the samples

DuckDB 1.5.5 · finetype 0.6.66

ValueAs DATE
01-15-242024-01-15
12-31-991999-12-31
%m
month, two digits
%d
day of month, two digits
%y
two-digit year

Pattern

Regular expression
^\d{2}-\d{2}-\d{2}$
ValueLengthShape
01-15-248matches
12-31-998matches
01-15-27rejected: one character short

Background

Origin

In the United States, dates are traditionally written in month-day-year order.[1] The slash is the most commonly used separator in the all-numeric form of a United States date.[1] Hyphens and periods have also emerged as separators in all-numeric United States dates, which the Wikipedia article on United States date notation attributes to globalisation.[1] A date such as 01-15-24 reads as the familiar American numeric date with the slashes swapped for hyphens and the century dropped. (Meridian's view)

In the 1960s, computer memory and mass storage were scarce and expensive.[2] Saving two digits for every date field was significant in the effort to keep data small.[2]

Use

The POSIX specification of strptime expects that a future version of the standard will change the default century inferred from a two-digit year.[3] Python's documentation says that time.strptime converts two-digit years according to the POSIX and ISO C standards, mapping 69 to 99 to 1969 to 1999 and 0 to 68 to 2000 to 2068.[4] DuckDB's date format documentation says that %y turns the numbers 00 to 68 into 2000 to 2068 and the numbers 69 to 99 into 1969 to 1999.[5]

By default, Excel reads a two-digit year from 00 to 29 as a year in the 2000s and from 30 to 99 as a year in the 1900s.[6] Microsoft says that when a date is imported or entered programmatically, Excel always applies its 2029 rule.[6]

How it's detected

Same regex as short_dmy — requires column-mode inference to disambiguate.

Schema

https://meridian.online/schemas/datetime.date.short_mdy · Frictionless type date · %m-%d-%y

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

Type Registry