Short Date (Day-Month-Year, 2-digit year)
datetime.date.short_dmyTwo-digit year, day-first. Dash-separated. Common in legacy systems and short-form data entry.
Operations on this type: Parse a date or time
Try a value
Short Date (Day-Month-Year, 2-digit year)'s rule accepts it.
Reads it as 2024-03-04
Also accepted by
- Short Date (Month-Day-Year, 2-digit year)
2024-04-03 - Short Date (Year-Month-Day, 2-digit year)
2004-03-24
Use it
finetype infer -i '15-01-24' --mode column
# → datetime.date.short_dmySELECT ft_infer('15-01-24');
-- → 'datetime.date.short_dmy'strptime({col}, '%d-%m-%y')::DATE
-- Format: %d-%m-%yHow finetype reads the samples
DuckDB 1.5.5 · finetype 0.6.66
| Value | As DATE |
|---|---|
| 15-01-24 | 2024-01-15 |
| 31-12-99 | 1999-12-31 |
- %d
- day of month, two digits
- %m
- month, two digits
- %y
- two-digit year
Written by
CLDR 46 via finetype 0.6.66
Each locale below writes this format with its CLDR date pattern at the styles named beside it.
es (CL) short · fy short · rm short · te short
Pattern
^\d{2}-\d{2}-\d{2}$| Value | Length | Shape |
|---|---|---|
| 15-01-24 | 8 | matches |
| 31-12-99 | 8 | matches |
| 15-01-2 | 7 | rejected: one character short |
Similar types
Going the other way, this type's own rule accepts 1 of 2 samples of Short Date (Year-Month-Day, 2-digit year).
Ambiguous with short_mdy in single-value mode (same regex pattern).
Background
Origin
Unicode CLDR's locale data for es-CL gives dd-MM-yy as the short Gregorian date pattern.[1] CLDR's locale data for fy gives dd-MM-yy as the short Gregorian date pattern.[2] CLDR's locale data for rm gives dd-MM-yy as the short Gregorian date pattern.[3] CLDR's locale data for te gives dd-MM-yy as the short Gregorian date pattern.[4]
The Netherlands records dates in day–month–year order, with 31-12-1999 given as an example.[5] In Dutch date notation, dashes are typically used as separators, although slashes are used as well.[5] In less formal Dutch texts, years may be shortened with an apostrophe when the century can be deduced from context.[5] Treat a Dutch file written with two-digit years as an informal abbreviation, and settle its century from context before you parse it. (Meridian's view)
Use
Depending on the order style, the abbreviated date 01/11/06 can be read as 1 November 2006 for DMY, among other readings.[6] A value such as 05-06-24 reads equally well as 5 June or 6 May, so a column whose first field never exceeds 12 cannot be told apart from month-first dashed dates by its values alone; look for a day above 12, the file's documentation or its country of origin before you commit to an order. (Meridian's view) pandas.to_datetime with dayfirst=True parses 10/11/12 as 2012-11-10.[7] The pandas documentation warns that dayfirst=True is not strict, but will prefer to parse with day first.[7]
DuckDB's %y specifier turns 00 to 68 into 2000 to 2068 and 69 to 99 into 1969 to 1999.[8] Python's time.strptime converts two-digit %y years according to the POSIX and ISO C standards, mapping 69–99 to 1969–1999 and 0–68 to 2000–2068.[9] Decide the century yourself before you cast, especially for birth dates and older records, rather than trusting whichever window a tool happens to apply. (Meridian's view) Microsoft advises typing year values as four digits, for example 2001 rather than 01, so that they are interpreted as intended.[10] Where you control the export, write four-digit years or ISO 8601 dates instead of this short form. (Meridian's view)
Sources
- [1]cldr-json/cldr-dates-full/main/es-CL/ca-gregorian.jsondocumentation
- [2]cldr-json/cldr-dates-full/main/fy/ca-gregorian.jsondocumentation
- [3]cldr-json/cldr-dates-full/main/rm/ca-gregorian.jsondocumentation
- [4]cldr-json/cldr-dates-full/main/te/ca-gregorian.jsondocumentation
- [5]Date and time notation in the Netherlandssecondary source
- [6]List of date formats by countrysecondary source
- [7]pandas.to_datetime — pandas 3.0.6 documentationdocumentation
- [8]Date Format Functionsdocumentation
- [9]time — Time access and conversions — Python 3.15.0 documentationdocumentation
- [10]Change the date system, format, or two-digit year interpretation | Microsoft Supportdocumentation
How it's detected
Ambiguous with short_mdy in single-value mode (same regex pattern). Column-mode disambiguation: if any value has first component > 12, it's DMY.
Schema
https://meridian.online/schemas/datetime.date.short_dmy · Frictionless type date · %d-%m-%y
finetype taxonomy datetime.date.short_dmy -o json-schema