# Month/Year (slash-separated)

Key: `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.

Page: <https://meridian.online/docs/finetype/types/datetime/date/month_year_slash>

Format: `%m/%Y`

Samples: `01/2024`, `12/2023`, `06/2000`, `12/25`, `03/26`

## Use it

Shell

```shell
finetype infer -i '01/2024' --mode column
# → datetime.date.month_year_slash
```

DuckDB

```sql
SELECT ft_infer('01/2024');
-- → 'datetime.date.month_year_slash'
```

Cast template: {col} is your column

```sql
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
```

## Background

### Origin

ISO/IEC 7813 is an international standard that defines properties of financial transaction cards, such as ATM or credit cards.[[1]](https://en.wikipedia.org/wiki/ISO/IEC_7813) Wikipedia's article on ISO/IEC 7813 gives the embossed expiration date of a card in the format MM/YY or MM-YY.[[1]](https://en.wikipedia.org/wiki/ISO/IEC_7813) 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]](https://www.cbaonline.cz/expiration-date-expiry-date)

### 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]](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html) In the HTML Standard, the canonical format of the cc-exp autofill field is a valid month string, with the example 2014-12.[[3]](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html) 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]](https://docs.stripe.com/api/cards/object) 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]](https://docs.python.org/3/library/time.html) 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)

## Sources

1. [ISO/IEC 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) — secondary source
2. [Expiration date, expiry date](https://www.cbaonline.cz/expiration-date-expiry-date) — secondary source
3. [HTML Standard](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html) — standard
4. [The Card object](https://docs.stripe.com/api/cards/object) — documentation
5. [time — Time access and conversions — Python 3.15.0 documentation](https://docs.python.org/3/library/time.html) — documentation

## 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.
