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

Key: `datetime.date.short_ymd`

Two-digit year, year-first (ISO-like ordering). Dash-separated.

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

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

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

## Use it

Shell

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

DuckDB

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

Cast template: {col} is your column

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

## Written by

Each locale below writes this format with its CLDR date pattern at the styles named beside it.

`eo` short

## Background

### Origin

ISO 8601:2000 allowed truncated representations by agreement, in which leading components of a date or time are omitted.[[1]](https://en.wikipedia.org/wiki/ISO_8601) The truncation provision of ISO 8601:2000 allowed two-digit years, including the YY-MM-DD format.[[1]](https://en.wikipedia.org/wiki/ISO_8601) The truncation provision was removed in ISO 8601:2004.[[1]](https://en.wikipedia.org/wiki/ISO_8601) ISO 8601 prescribes a four-digit year as a minimum, to avoid the year 2000 problem.[[1]](https://en.wikipedia.org/wiki/ISO_8601)

RFC 3339, Date and Time on the Internet: Timestamps, says the use of 2-digit years is deprecated.[[2]](https://www.rfc-editor.org/rfc/rfc3339) RFC 3339 requires Internet protocols to generate four digit years in dates.[[2]](https://www.rfc-editor.org/rfc/rfc3339)

### Use

Wikipedia's article on Swedish date notation says Swedish dates can be shortened to two-digit years, written in the form YY-MM-DD.[[3]](https://en.wikipedia.org/wiki/Date_and_time_notation_in_Sweden)

Python's time.strptime maps two-digit years 69–99 to 1969–1999 and 0–68 to 2000–2068.[[4]](https://docs.python.org/3/library/time.html) Python's documentation says that two-digit year conversion follows the POSIX and ISO C standards.[[4]](https://docs.python.org/3/library/time.html) DuckDB's %y specifier turns the numbers 00 to 68 into 2000 to 2068, and 69 to 99 into 1969 to 1999.[[5]](https://duckdb.org/docs/current/sql/functions/dateformat.html) Before casting, compare the range of years a file should cover with the pivot your parser uses, and supply the century yourself when the two disagree. (Meridian's view)

RFC 3339 says a received 2-digit year should be accepted only if an incorrect interpretation will not cause a protocol or processing failure.[[2]](https://www.rfc-editor.org/rfc/rfc3339) A value like 05-06-07 reads equally well as year-month-day, day-month-year or month-day-year, so judge the order from a whole column of values rather than from one. (Meridian's view)

### Where you'll meet it

The Unicode CLDR locale data gives Esperanto's short date format as yy-MM-dd.[[6]](https://raw.githubusercontent.com/unicode-org/cldr-json/main/cldr-json/cldr-dates-full/main/eo/ca-gregorian.json)

## Sources

1. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) — secondary source
2. [RFC 3339: Date and Time on the Internet: Timestamps](https://www.rfc-editor.org/rfc/rfc3339) — standard
3. [Date and time notation in Sweden](https://en.wikipedia.org/wiki/Date_and_time_notation_in_Sweden) — secondary source
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. [cldr-json/cldr-dates-full/main/eo/ca-gregorian.json](https://raw.githubusercontent.com/unicode-org/cldr-json/main/cldr-json/cldr-dates-full/main/eo/ca-gregorian.json) — dataset
