Meridianmeridian

Month/Year (slash-separated)

datetime.date.month_year_slash

Numeric Month/Year with slash separator. No day component. Billing data, credit card contexts, expiration-like formats.

Domain
datetime
Category
date
Casts to
DATE
Scope
Universal

Try it

CLI
$ finetype infer -i "01/2024"
→ datetime.date.month_year_slash

DuckDB

Detect
SELECT finetype('01/2024');
-- → 'datetime.date.month_year_slash'
Cast expression
strptime('01/' || {col}, '%d/%m/%Y')::DATE
-- Format: %m/%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.month_year_slash';

Struct Expansion

Expression
month: CAST(SUBSTRING({col}, 1, 2) AS INT)
year: CAST(SUBSTRING({col}, 4, 4) AS INT)

JSON Schema

finetype schema datetime.date.month_year_slash
{
  "$id": "https://meridian.online/schemas/datetime.date.month_year_slash",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "Numeric Month/Year with slash separator. No day component. Billing data, credit card contexts, expiration-like formats.",
  "examples": [
    "01/2024",
    "12/2023",
    "06/2000"
  ],
  "maxLength": 7,
  "minLength": 7,
  "pattern": "^(0[1-9]|1[0-2])/\\d{4}$",
  "title": "Month/Year (slash-separated)",
  "type": "string",
  "x-finetype-broad-type": "DATE",
  "x-finetype-format-string": "%m/%Y",
  "x-finetype-transform": "strptime('01/' || {col}, '%d/%m/%Y')::DATE"
}

Examples

01/202412/202306/2000