Skip to content

Compact Date (MMDDYYYY)

Type Registry

Compact Date (MMDDYYYY)

datetime.date.compact_mdy

Eight-digit date with no separators, month-first (US ordering).

Domain datetimedate
Casts to DATE
Scope Universal

Try it

CLI
$ finetype infer -i "01152024"
→ datetime.date.compact_mdy

DuckDB

Detect
SELECT finetype('01152024');
-- → 'datetime.date.compact_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.compact_mdy';

JSON Schema

finetype schema datetime.date.compact_mdy
{
  "$id": "https://noon.sh/schemas/datetime.date.compact_mdy",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "Eight-digit date with no separators, month-first (US ordering).",
  "examples": [
    "01152024",
    "12312019"
  ],
  "maxLength": 8,
  "minLength": 8,
  "pattern": "^\\d{8}$",
  "title": "Compact Date (MMDDYYYY)",
  "type": "string"
}

Examples

0115202412312019

Also known as

numeric_mdy

Types in datetime