Full Month Year
datetime.date.month_year_fullFull month name followed by 4-digit year. No day component. Financial reports, government statistical publications.
Operations on this type: Parse a date or time
Try a value
Full Month Year's rule accepts it.
Reads it as 2024-03-01
Use it
finetype infer -i 'January 2024' --mode column
# → datetime.date.month_year_fullSELECT ft_infer('January 2024');
-- → 'datetime.date.month_year_full'strptime('01 ' || {col}, '%d %B %Y')::DATE
-- Format: %B %YHow finetype reads the samples
DuckDB 1.5.5 · finetype 0.6.66
| Value | As DATE |
|---|---|
| January 2024 | 2024-01-01 |
| December 2023 | 2023-12-01 |
| June 2000 | 2000-06-01 |
- %B
- full month name
- %Y
- four-digit year
Pattern
Length 8 to 14 characters.
^[A-Z][a-z]+ \d{4}$| Value | Length | Shape |
|---|---|---|
| January 2024 | 12 | matches |
| December 2023 | 13 | matches |
| June 2000 | 9 | matches |
| January 202 | 11 | rejected: one character short |
Similar types
Going the other way, this type's own rule accepts 1 of 6 samples of Abbreviated Month Year.
Background
Origin
POSIX.1-2024 defines %B as being replaced by the locale's full month name.[1] The POSIX.1-2024 rationale notes that %Y was frequently assumed to be a four-digit year, although the ISO C standard does not restrict it that way.[1]
The Grammarphobia Blog advises that no comma is needed when only the month and year are given, as in March 2009.[2]
Use
A month-and-year value names a whole calendar month, not a day, so treat it as a period rather than a date that happens to lack its day. (Meridian's view) Because the month name follows the locale, check which language a file was written in before you parse it, and fix the parsing locale rather than trusting the machine's default. (Meridian's view) DuckDB's date format functions list %B as the full month name, with examples January, February, ….[3]
Python's time.strptime fills missing data with the default values (1900, 1, 1, 0, 0, 0, 0, 1, -1) when more accurate values cannot be inferred.[4] A parser that silently supplies the first of the month is convenient, but record that the day was invented, so nobody later reads 2024-01-01 as an event on New Year's Day. (Meridian's view) ISO 8601 allows a calendar date to be written with reduced precision, so that 2004-05 indicates May 2004.[5] The Wikipedia article on ISO 8601 notes that a reduced-precision value such as 2004-05 will never represent the 5th day of an unspecified month in 2004.[5] When you store the value, consider the reduced-precision ISO form YYYY-MM, which keeps the month without inventing a day. (Meridian's view)
Where you'll meet it
The Census Bureau's text file of combined seasonal, trading-day and holiday adjustment factors for retail sales labels its monthly columns in a shorter form, such as Jul 25 and Aug 25.[6] A publisher may write the full form in its releases and a shorter form in its data files, so map both to the same month before joining them. (Meridian's view)
Sources
- [1]strftimestandard
- [2]The Grammarphobia Blog: Dating servicesecondary source
- [3]Date Format Functions – DuckDBdocumentation
- [4]time — Time access and conversions — Python 3.15.0 documentationdocumentation
- [5]ISO 8601 - Wikipediasecondary source
- [6]Combined Seasonal, Trading-Day, and Holiday Adjustment Factors for U.S. Retail Sales and Food Services by Kind of Businessdataset
How it's detected
Financial reports, gov statistics.
Schema
https://meridian.online/schemas/datetime.date.month_year_full · Frictionless type date · %B %Y
finetype taxonomy datetime.date.month_year_full -o json-schema