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

Key: `datetime.date.short_mdy`

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

Page: <https://meridian.online/docs/finetype/types/datetime/date/short_mdy>

Format: `%m-%d-%y`

Samples: `01-15-24`, `12-31-99`

## Use it

Shell

```shell
finetype infer -i '01-15-24' --mode column
# → datetime.date.short_mdy
```

DuckDB

```sql
SELECT ft_infer('01-15-24');
-- → 'datetime.date.short_mdy'
```

Cast template: {col} is your column

```sql
strptime({col}, '%m-%d-%y')::DATE
-- Format: %m-%d-%y
```

## Background

### Origin

In the United States, dates are traditionally written in month-day-year order.[[1]](https://en.wikipedia.org/wiki/Date_and_time_notation_in_the_United_States) The slash is the most commonly used separator in the all-numeric form of a United States date.[[1]](https://en.wikipedia.org/wiki/Date_and_time_notation_in_the_United_States) 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]](https://en.wikipedia.org/wiki/Date_and_time_notation_in_the_United_States) 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]](https://en.wikipedia.org/wiki/Year_2000_problem) Saving two digits for every date field was significant in the effort to keep data small.[[2]](https://en.wikipedia.org/wiki/Year_2000_problem)

### 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]](https://pubs.opengroup.org/onlinepubs/9799919799/functions/strptime.html) 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]](https://docs.python.org/3/library/time.html) 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]](https://duckdb.org/docs/current/sql/functions/dateformat.html)

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]](https://learn.microsoft.com/en-us/troubleshoot/microsoft-365-apps/excel/two-digit-year-numbers) Microsoft says that when a date is imported or entered programmatically, Excel always applies its 2029 rule.[[6]](https://learn.microsoft.com/en-us/troubleshoot/microsoft-365-apps/excel/two-digit-year-numbers)

## Sources

1. [Date and time notation in the United States](https://en.wikipedia.org/wiki/Date_and_time_notation_in_the_United_States) — secondary source
2. [Year 2000 problem](https://en.wikipedia.org/wiki/Year_2000_problem) — secondary source
3. [strptime](https://pubs.opengroup.org/onlinepubs/9799919799/functions/strptime.html) — standard
4. [time — Time access and conversions](https://docs.python.org/3/library/time.html) — documentation
5. [Date Format Functions](https://duckdb.org/docs/current/sql/functions/dateformat.html) — documentation
6. [How Excel works with two-digit year numbers - Microsoft 365 Apps \| Microsoft Learn](https://learn.microsoft.com/en-us/troubleshoot/microsoft-365-apps/excel/two-digit-year-numbers) — documentation

## How it's detected

Same regex as short\_dmy — requires column-mode inference to disambiguate.
