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).
Try a value
Abbreviated Month Date's rule accepts it.
Reads it as 2024-03-04
Worked samples
DuckDB 1.5.5 · finetype 0.6.66
| 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.66
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. The rule also accepts two forms the transform cannot cast: a day with a full stop before the month (4. Feb 2023) and a month-first date with no comma (Feb 4 2023); both validate and stay text. For discrimination (column typing), a value counts only when its month token is a Unicode CLDR abbreviated month for one of the Latin-script locales above (4 Feb 2023, 4 janv. 2023, 4 ene 2023); full month names (4 February 2023) and ordinary words (Room 12, 2023) fit the rule's shape but are not counted. AP style spells out March to July; a spelled-out March, April, June or July, month-first (March 4, 2023) or day-first (4 March 2023), is long_full_month's form and is not counted here, so an AP column counts its abbreviated months (Feb. 4, 2023) and May, which is its own abbreviation. The rule's letters stop at Latin-1, so the Czech and Polish abbreviations with letters outside it (bře, kvě, čvn, čvc, zář, říj, paź) are not accepted yet.
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