Short Date (Month-Day-Year, 2-digit year)
datetime.date.short_mdyTwo-digit year, month-first (US ordering). Dash-separated.
Operations on this type: Parse a date or time
Try a value
Short Date (Month-Day-Year, 2-digit year)'s rule accepts it.
Reads it as 2024-03-04
Also accepted by
- Short Date (Day-Month-Year, 2-digit year)
2024-04-03 - Short Date (Year-Month-Day, 2-digit year)
2003-04-24
Use it
finetype infer -i '01-15-24' --mode column
# → datetime.date.short_mdySELECT ft_infer('01-15-24');
-- → 'datetime.date.short_mdy'strptime({col}, '%m-%d-%y')::DATE
-- Format: %m-%d-%yHow finetype reads the samples
DuckDB 1.5.5 · finetype 0.6.66
| Value | As DATE |
|---|---|
| 01-15-24 | 2024-01-15 |
| 12-31-99 | 1999-12-31 |
- %m
- month, two digits
- %d
- day of month, two digits
- %y
- two-digit year
Pattern
^\d{2}-\d{2}-\d{2}$| Value | Length | Shape |
|---|---|---|
| 01-15-24 | 8 | matches |
| 12-31-99 | 8 | matches |
| 01-15-2 | 7 | rejected: one character short |
Background
Origin
In the United States, dates are traditionally written in month-day-year order.[1] The slash is the most commonly used separator in the all-numeric form of a United States date.[1] Hyphens and periods have also emerged as separators in all-numeric United States dates, which the Wikipedia article on United States date notation attributes to globalisation.[1] A date such as 01-15-24 reads as the familiar American numeric date with the slashes swapped for hyphens and the century dropped. (Meridian's view)
In the 1960s, computer memory and mass storage were scarce and expensive.[2] Saving two digits for every date field was significant in the effort to keep data small.[2]
Use
The POSIX specification of strptime expects that a future version of the standard will change the default century inferred from a two-digit year.[3] Python's documentation says that time.strptime converts two-digit years according to the POSIX and ISO C standards, mapping 69 to 99 to 1969 to 1999 and 0 to 68 to 2000 to 2068.[4] DuckDB's date format documentation says that %y turns the numbers 00 to 68 into 2000 to 2068 and the numbers 69 to 99 into 1969 to 1999.[5]
By default, Excel reads a two-digit year from 00 to 29 as a year in the 2000s and from 30 to 99 as a year in the 1900s.[6] Microsoft says that when a date is imported or entered programmatically, Excel always applies its 2029 rule.[6]
Sources
- [1]Date and time notation in the United Statessecondary source
- [2]Year 2000 problemsecondary source
- [3]strptimestandard
- [4]time — Time access and conversionsdocumentation
- [5]Date Format Functionsdocumentation
- [6]How Excel works with two-digit year numbers - Microsoft 365 Apps | Microsoft Learndocumentation
How it's detected
Same regex as short_dmy — requires column-mode inference to disambiguate.
Schema
https://meridian.online/schemas/datetime.date.short_mdy · Frictionless type date · %m-%d-%y
finetype taxonomy datetime.date.short_mdy -o json-schema