Skip to content

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

Type Registry

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

datetime.date.short_ymd

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

Domain datetimedate
Casts to DATE
Scope Universal

Try it

CLI
$ finetype infer -i "24-01-15"
→ datetime.date.short_ymd

DuckDB

Detect
SELECT finetype('24-01-15');
-- → 'datetime.date.short_ymd'
Cast expression
strptime({col}, '%y-%m-%d')::DATE
Format: %y-%m-%d
Safe cast pipeline
-- Normalise and cast in one step
SELECT TRY_CAST(finetype_cast(my_column) AS DATE) AS clean_value
FROM my_table
WHERE finetype(my_column) = 'datetime.date.short_ymd';

JSON Schema

finetype schema datetime.date.short_ymd
{
  "$id": "https://noon.sh/schemas/datetime.date.short_ymd",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "Two-digit year, year-first (ISO-like ordering). Dash-separated.",
  "examples": [
    "24-01-15",
    "99-12-31"
  ],
  "maxLength": 8,
  "minLength": 8,
  "pattern": "^\\d{2}-\\d{2}-\\d{2}$",
  "title": "Short Date (Year-Month-Day, 2-digit year)",
  "type": "string"
}

Examples

24-01-1599-12-31

Types in datetime