Skip to content

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

Type Registry

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

datetime.date.short_mdy

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

Domain datetimedate
Casts to DATE
Scope Universal

Try it

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

DuckDB

Detect
SELECT finetype('01-15-24');
-- → 'datetime.date.short_mdy'
Cast expression
strptime({col}, '%m-%d-%y')::DATE
Format: %m-%d-%y
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_mdy';

JSON Schema

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

Examples

01-15-2412-31-99

Types in datetime