MeridianMERIDIAN

Month/Year (slash-separated)

datetime.date.month_year_slash

Numeric Month/Year with slash separator. No day component. Accepts both MM/YYYY and MM/YY formats. Common in billing data, credit card expiration dates, and financial periodization.

Operations on this type: Parse a date or time, Parse nested values

Try a value

Month/Year (slash-separated)'s rule accepts it.

Reads it as 2024-03-01

Use it

Shell
finetype infer -i '01/2024' --mode column
# → datetime.date.month_year_slash
DuckDB
SELECT ft_infer('01/2024');
-- → 'datetime.date.month_year_slash'
Cast template: {col} is your column
CASE WHEN LENGTH({col}) = 5 THEN strptime('01/' || SUBSTRING({col}, 1, 2) || '/20' || SUBSTRING({col}, 4, 2), '%d/%m/%Y')::DATE ELSE strptime('01/' || {col}, '%d/%m/%Y')::DATE END
-- Format: %m/%Y

How finetype reads the samples

DuckDB 1.5.5 · finetype 0.6.66

ValueAs DATEmonthyear
01/20242024-01-0112024
12/20232023-12-01122023
06/20002000-06-0162000
12/252025-12-01122025
03/262026-03-0132026
%m
month, two digits
%Y
four-digit year

Pattern

Length 5 to 7 characters.

Regular expression
^(0[1-9]|1[0-2])/(\d{2}|\d{4})$
ValueLengthShape
01/20247matches
12/20237matches
06/20007matches
12/255matches
03/265matches
01/2026rejected: one character short

Background

Origin

ISO/IEC 7813 is an international standard that defines properties of financial transaction cards, such as ATM or credit cards.[1] Wikipedia's article on ISO/IEC 7813 gives the embossed expiration date of a card in the format MM/YY or MM-YY.[1] A payment card's expiry date is displayed on the front of the card in MM/YY format and is also stored electronically on a magnetic stripe or chip.[2]

Use

The HTML Standard notes that a credit card expiry date can be expressed as one field giving both the month and year of expiry, or as two fields, one giving the month and one the year.[3] In the HTML Standard, the canonical format of the cc-exp autofill field is a valid month string, with the example 2014-12.[3] Stripe's API describes a card's exp_month as a two-digit number representing the expiration month and exp_year as a four-digit number representing the expiration year.[4] Be ready for both MM/YY and MM/YYYY in one column, since a value copied from the card face and one assembled from separate month and year fields can differ in length. (Meridian's view)

Python's time documentation says that two-digit years parsed with %y are converted according to the POSIX and ISO C standards, with values 69–99 mapped to 1969–1999 and values 0–68 mapped to 2000–2068.[5] Decide the century of a two-digit year yourself and write the rule down, rather than leaving it to whatever pivot a parsing library happens to apply. (Meridian's view) A short value such as 12/25 could just as well be a month and a day, so confirm from the column name or its neighbours that the part after the slash is a year before you cast it. (Meridian's view) Casting to the first day of the month gives a handy key for sorting and joining, but an expiry or billing value names the whole month, not that single day. (Meridian's view)

How it's detected

Billing data, financial periodization. Widened to accept MM/YY format (credit card expiration dates) after collapsing finance.payment.credit_card_expiration_date into this type.

Schema

https://meridian.online/schemas/datetime.date.month_year_slash · Frictionless type date · %m/%Y

finetype taxonomy datetime.date.month_year_slash -o json-schema

Aliases

card_expiry

Type Registry