MDY Date (slash-separated)
datetime.date.mdy_slashwas datetime.formatted_date in v1Month/Day/Year with slash separators. Standard US date format. Ambiguous with DMY format for days 1-12 — column-mode inference uses value distribution to disambiguate.
Worked samples
DuckDB 1.5.5 · finetype 0.6.64
| Value | As DATE |
|---|---|
| 01/15/2024 | 2024-01-15 |
| 12/31/2019 | 2019-12-31 |
- %m
- month, two digits
- %d
- day of month, two digits
- %Y
- four-digit year
Written by
CLDR 46 via finetype 0.6.64
Each locale below writes this format with its CLDR date pattern at the styles named beside it.
es (PA, PR) medium · iu short
Shape
^\d{2}/\d{2}/\d{4}$| Value | Length | Shape |
|---|---|---|
| 01/15/2024 | 10 | matches |
| 12/31/2019 | 10 | matches |
| 01/15/202 | 9 | rejected: one character short |
Background
Origin
In the United States, dates are traditionally written in month-day-year order, with neither increasing nor decreasing order of significance.[1] The month-day-year order is described as middle endian.[1] The traditional American all-numeric date follows the same month-day-year order, as in 01/21/2024.[1] The slash is the most commonly used separator in the American all-numeric date.[1] The hyphen and the period have also emerged as separators in the American all-numeric format, a change attributed to globalisation.[1]
In the Unicode CLDR locale data, the medium date pattern for Spanish as used in Puerto Rico (es-PR) is MM/dd/y.[2] In the Unicode CLDR locale data, the medium date pattern for Spanish as used in Panama (es-PA) is MM/dd/y.[3]
Use
In SQL Server, CONVERT style 101 is labelled U.S. and produces MM/dd/yyyy.[4] The SQL Server documentation's example of CONVERT style 101 returns 08/23/2019.[4] In Python's strftime and strptime format codes, %m is the month as a zero-padded decimal number.[5] In Python's strftime and strptime format codes, %d is the day of the month as a zero-padded decimal number.[5] Python's documentation gives 08/16/1988 as the en_US example of %x, the locale's appropriate date representation.[5]
American notation has influenced date notation in Canada, creating confusion in international commerce.[1] The Chicago Manual of Style discourages all-numeric dates other than the ISO 8601 year-month-day form, because they are not comprehensible to readers outside the United States.[1] Any value whose first two numbers are both 12 or under reads equally well as month-first or day-first, so one row cannot tell you which order a file uses. (Meridian's view) Look down the whole column for a first field above 12, which settles the file as day-first, or a second field above 12, which settles it as month-first, before you parse anything. (Meridian's view) When every value in a column is ambiguous, ask where the file came from and which convention its producer follows before choosing an order. (Meridian's view)
Where you'll meet it
The U.S. Department of the Treasury's Daily Treasury Par Yield Curve Rates table writes its dates as month/day/year with slashes, such as 12/31/2024.[6]
Sources
- [1]Date and time notation in the United Statessecondary source
- [2]ca-gregorian.json (es-PR)documentation
- [3]ca-gregorian.json (es-PA)documentation
- [4]CAST and CONVERT (Transact-SQL) - SQL Server | Microsoft Learndocumentation
- [5]datetime — Basic date and time typesdocumentation
- [6]Daily Treasury Rates | U.S. Department of the Treasurydataset
Detection notes
v1 name: datetime.formatted_date. Ambiguous with dmy_slash when day <= 12.
Use it
$ finetype infer -i "01/15/2024" --mode column
→ datetime.date.mdy_slash
SELECT ft_infer('01/15/2024');
-- → 'datetime.date.mdy_slash'strptime({col}, '%m/%d/%Y')::DATE
-- Format: %m/%d/%YSchema
https://meridian.online/schemas/datetime.date.mdy_slash · Frictionless type date · %m/%d/%Y
finetype taxonomy datetime.date.mdy_slash -o json-schema