MeridianMERIDIAN

DMY Date with Abbreviated Month (space-separated)

datetime.date.dmy_space_abbrev

Day Month-Abbr Year with space separators. Unambiguous due to named month. RFC 2822 date portion, military/NATO records, PostgreSQL to_char.

Operations on this type: Parse a date or time

Try a value

DMY Date with Abbreviated Month (space-separated)'s rule accepts it.

Reads it as 2024-03-04

Use it

Shell
finetype infer -i '15 Jan 2024' --mode column
# → datetime.date.dmy_space_abbrev
DuckDB
SELECT ft_infer('15 Jan 2024');
-- → 'datetime.date.dmy_space_abbrev'
Cast template: {col} is your column
strptime({col}, '%d %b %Y')::DATE
-- Format: %d %b %Y

How finetype reads the samples

DuckDB 1.5.5 · finetype 0.6.66

ValueAs DATE
15 Jan 20242024-01-15
31 Dec 20232023-12-31
1 Jun 20002000-06-01
%d
day of month, two digits
%b
abbreviated month name
%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 (AE) medium · naq medium

Pattern

Length 10 to 11 characters.

Regular expression
^[0-3]?\d [A-Z][a-z]{2} \d{4}$
ValueLengthShape
15 Jan 202411matches
31 Dec 202311matches
1 Jun 200010matches
15 Jan 20210rejected: one character short

Similar types

Going the other way, this type's own rule accepts 1 of 3 samples of Abbreviated Month Date.

Background

Origin

RFC 822 defines a date as a one- or two-digit day, a month and a two-digit year, with the example 20 Jun 82.[1] RFC 822 lists the months as the three-letter abbreviations Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov and Dec.[1]

RFC 1123, published in October 1989, changed the date syntax of RFC 822 to allow a year of two to four digits.[2] RFC 1123 says all mail software SHOULD use 4-digit years in dates, to ease the transition to the next century.[2]

In RFC 2822 the day is one or two digits and the year is four or more digits.[3] RFC 2822 says the year is any numeric year 1900 or later.[3] RFC 5322, published in October 2008, obsoletes RFC 2822.[4] RFC 5322 requires the numeric day-of-month to be between 1 and the number of days allowed for the specified month in the specified year.[4]

Use

In PostgreSQL's to_char templates, Mon is the abbreviated capitalised month name, three characters in English.[5] PostgreSQL's DD template pattern writes the day of month as 01 to 31.[5] PostgreSQL's FM prefix suppresses the leading zeroes and padding blanks that would otherwise make a pattern's output fixed-width.[5] PostgreSQL's to_date ignores letter case in the input, so MON, Mon and mon all accept the same strings.[5]

Python's documentation notes that when %d is used with strptime, the leading zero is optional.[6] Because the day may or may not carry a leading zero, a column can hold both 01 Jun 2000 and 1 Jun 2000, and a parser should accept both. (Meridian's view) The month names are the fragile part: pin the parser to English month abbreviations rather than relying on the machine's locale. (Meridian's view) A date with a spelled-out month cannot be misread as month-first or day-first, which makes it a sensible choice for files read by people in different countries. (Meridian's view) Watch for a two-digit-year cousin, such as 20 Jun 82, which needs a century decided before it can be cast. (Meridian's view)

How it's detected

RFC 2822 date portion, military/NATO.

Schema

https://meridian.online/schemas/datetime.date.dmy_space_abbrev · Frictionless type date · %d %b %Y

finetype taxonomy datetime.date.dmy_space_abbrev -o json-schema

Type Registry