Day-first vs month-first dates
The types
| Type | Form | Pattern | DuckDB transform | Sample |
|---|---|---|---|---|
| DMY Date (slash-separated) | Day first, slashes | ^\d{2}/\d{2}/\d{4}$ | strptime({col}, '%d/%m/%Y')::DATE | 15/01/2024 |
| MDY Date (slash-separated) | Month first, slashes | ^\d{2}/\d{2}/\d{4}$ | strptime({col}, '%m/%d/%Y')::DATE | 01/15/2024 |
| DMY Date (dash-separated) | Day first, dashes | ^\d{2}-\d{2}-\d{4}$ | strptime({col}, '%d-%m-%Y')::DATE | 15-01-2024 |
| MDY Date (dash-separated) | Month first, dashes | ^\d{2}-\d{2}-\d{4}$ | strptime({col}, '%m-%d-%Y')::DATE | 01-15-2024 |
How finetype tells them apart
From finetype 0.6.66's source.
finetype's datetime format reader treats two digits, a slash, two digits, a slash and four digits as one shape that is either dmy_slash or mdy_slash, and the same shape with dashes as either dmy_dash or mdy_dash.[1] It counts a value towards that shape only when both two-digit fields are between 1 and 31 and the year is between 1000 and 9999.[2][3] A value whose first field is over 12 and whose second is 12 or under is evidence that the day comes first, and a value with those fields the other way round is evidence that the month comes first.[4] The reader names a type only when at least 95% of the column's sampled non-null values fit the shape and all of the evidence points one way.[5][6] When no value has a field over 12, or some values point each way, the reader returns nothing; finetype's source says it never guesses the locale.[7][8]
finetype applies the reader's choice only when at least 90% of the column's non-empty sampled values pass the chosen type's own validation rule.[9][10] Earlier in the same pipeline, a value rule takes a column finetype's model has labelled dmy_slash or mdy_slash and changes the label to dmy_slash when some value's first field is over 12 and no value's second field is, or to mdy_slash the other way round.[11][12][13] When neither field ever goes over 12, or both do, that rule leaves the model's label as it was, and when the reader returns nothing the reader's step leaves the column's type as it was too.[14][15]
finetype's own tests pin 31/01/2020 with 05/06/2019 as dmy_slash, 01/31/2020 with 06/05/2019 as mdy_slash, and both 01/02/2020 with 03/04/2019 and 31/01/2020 with 01/31/2020 as read by neither.[16]
A column in which no day is over 12 cannot be settled from its values, so its order has to come from whoever wrote the file, its documentation or its country of origin. (Meridian's view)
What finetype's evaluation shows
The evaluation report in finetype's repository at release 0.6.66 measured release 0.6.60 on 2026-09-23.[17] The report says its tables are generated by a separate tool that has drifted from the SQL harness it claims to mirror, and that a figure taken from it for publication must be its SQL headline.[18] Until finetype publishes a measurement for each type, this page gives no figure for how often it mistakes one order for the other. (Meridian's view)
Who writes each form
Day first, slashes
In the United Kingdom, dates are traditionally and most commonly written in day–month–year order.[19] The Australian Government Style Manual says to separate the numbers in a numeric date with an unspaced forward slash, using the format day/month/year.[20] In the Unicode CLDR locale data, the short date pattern for British English (en-GB) is dd/MM/y.[21] The UK Trade Tariff service's monthly exchange rate file for January 2024 writes its Start date and End date columns as 01/01/2024 and 31/01/2024.[22]
Month first, slashes
In the United States, dates are traditionally written in month-day-year order, with neither increasing nor decreasing order of significance.[23] In SQL Server, CONVERT style 101 is labelled U.S. and produces MM/dd/yyyy.[24] Python's documentation gives 08/16/1988 as the en_US example of %x, the locale's appropriate date representation.[25] 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.[26]
Day first, dashes
The Netherlands records dates in day–month–year order, with 31-12-1999 given as an example.[27] Unicode's CLDR gives Dutch (nl) the short Gregorian date pattern dd-MM-y.[28] In India, DD-MM-YYYY and DD/MM/YYYY are described as the two predominant short forms of the Gregorian date.[29] StatsWales's SW3 publishing platform accepts DD-MM-YYYY in data tables, with 01-01-2022 shown on the website as 1 January 2022.[30]
Month first, dashes
Microsoft SQL Server's CONVERT function lists style 110, under the standard USA, as MM-dd-yyyy.[31] According to Wikipedia, the hyphen and the period have also emerged as separators in the all-numeric American date recently, due to globalisation.[23]
Sources
- [1]finetype 0.6.66, datetime_format.rsFineType
- [2]finetype 0.6.66, datetime_format.rsFineType
- [3]finetype 0.6.66, datetime_format.rsFineType
- [4]finetype 0.6.66, datetime_format.rsFineType
- [5]finetype 0.6.66, datetime_format.rsFineType
- [6]finetype 0.6.66, datetime_format.rsFineType
- [7]finetype 0.6.66, datetime_format.rsFineType
- [8]finetype 0.6.66, datetime_format.rsFineType
- [9]finetype 0.6.66, column/mod.rsFineType
- [10]finetype 0.6.66, column/mod.rsFineType
- [11]finetype 0.6.66, column/mod.rsFineType
- [12]finetype 0.6.66, value_sharpen.rsFineType
- [13]finetype 0.6.66, datetime_rules.rsFineType
- [14]finetype 0.6.66, datetime_rules.rsFineType
- [15]finetype 0.6.66, column/mod.rsFineType
- [16]finetype 0.6.66, datetime_format.rsFineType
- [17]finetype evaluation report (release 0.6.60)FineType
- [18]finetype evaluation report (release 0.6.60)FineType
- [19]Date and time notation in the United Kingdomsecondary source
- [20]Dates and time | Style Manualorganisation
- [21]ca-gregorian.json (en-GB)documentation
- [22]monthly_csv_2024-1.csvdataset
- [23]Date and time notation in the United Statessecondary source
- [24]CAST and CONVERT (Transact-SQL) - SQL Server | Microsoft Learndocumentation
- [25]datetime — Basic date and time typesdocumentation
- [26]Daily Treasury Rates | U.S. Department of the Treasurydataset
- [27]Date and time notation in the Netherlandssecondary source
- [28]ca-gregorian.jsondocumentation
- [29]Date and time notation in Indiasecondary source
- [30]Data preparation: New datasets | StatsWalesorganisation
- [31]CAST and CONVERT (Transact-SQL) - SQL Server | Microsoft Learndocumentation