Abbreviated Month Date
datetime.date.abbreviated_monthDate with an abbreviated month name, month-first (Feb 4, 2023) or day-first (4 Feb 2023, 4 Feb 23). Locale-specific because month abbreviations vary by language (Jan vs janv. vs ene). The month token is any run of three or more Latin letters with an optional full stop, which takes the abbreviations of Unicode CLDR in en (Feb), en-GB (Sept), fr (janv.) and the other locales, and the dotted AP-style form (Feb. 4, 2023).
Worked samples
DuckDB 1.5.5 · finetype 0.6.64
| Value | As DATE |
|---|---|
| Jan 15, 2024 | 2024-01-15 |
| 15 Jan 2024 | 2024-01-15 |
| Dec 31, 2019 | 2019-12-31 |
- %b
- abbreviated month name
- %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.
en medium · en (AS, BI, CA, GU, MH, MP, PH, PR, UM, VI) medium
Shape
^(?:[A-Za-zÀ-ÖØ-öø-ÿ]{3,}\.? \d{1,2},? \d{4}|\d{1,2}\.? [A-Za-zÀ-ÖØ-öø-ÿ]{3,}\.? (?:\d{4}|\d{2}))$| Value | Length | Shape |
|---|---|---|
| Jan 15, 2024 | 12 | matches |
| 15 Jan 2024 | 11 | matches |
| Dec 31, 2019 | 12 | matches |
| Jan 15, 202 | 11 | rejected: one character short |
Background
Origin
In POSIX strftime, the %b conversion specifier is replaced by the locale's abbreviated month name.[1] POSIX defines %h as equivalent to %b.[1]
RFC 5322, the Internet Message Format, defines the date in a message header as a day, then a month, then a year.[2] RFC 5322 restricts the month to twelve three-letter English names, from Jan to Dec.[2]
Unicode's LDML date pattern syntax writes the abbreviated month as MMM, with Sep as its example.[3] In the CLDR data for the en locale, the medium date format is MMM d, y.[4] CLDR's en-GB locale uses d MMM y as its medium date format instead.[5]
Use
Wikipedia's article on United States date notation says that in traditional American usage, dates are written in month–day–year order.[6]
Sources
- [1]strftimestandard
- [2]RFC 5322: Internet Message Formatstandard
- [3]Unicode Locale Data Markup Language (LDML) Part 4: Datesstandard
- [4]ca-gregorian.jsondataset
- [5]ca-gregorian.jsondataset
- [6]Date and time notation in the United Statessecondary source
Detection notes
The month token is letter-based, so French and other non-English abbreviations are recognised but not castable: the transform uses DuckDB strptime, whose %b reads English month names, so a column of 4 janv. 2023 validates and stays text. The transform first rewrites Sept (en-GB) to Sep. Per-locale samples needed for non-EN locales.
Use it
$ finetype infer -i "Jan 15, 2024" --mode column
→ datetime.date.abbreviated_month
SELECT ft_infer('Jan 15, 2024');
-- → 'datetime.date.abbreviated_month'strptime(regexp_replace({col}, '\bSept\b', 'Sep'), ['%b %d, %Y', '%b. %d, %Y', '%d %b %y', '%d %b. %y', '%d %b %Y', '%d %b. %Y'])::DATE
-- Format: %b %d, %YSchema
https://meridian.online/schemas/datetime.date.abbreviated_month · Frictionless type date · %b %d, %Y
finetype taxonomy datetime.date.abbreviated_month -o json-schema