YMD Date (slash-separated)
datetime.date.ymd_slashYear/Month/Day with slash separators. Unambiguous due to year-first ordering. CLDR ja-JP short format; standard in Japanese and Taiwanese CSV exports.
Worked samples
DuckDB 1.5.5 · finetype 0.6.64
| Value | As DATE |
|---|---|
| 2024/01/15 | 2024-01-15 |
| 2023/12/31 | 2023-12-31 |
| 2000/06/01 | 2000-06-01 |
- %Y
- four-digit year
- %m
- month, two digits
- %d
- day of month, two digits
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 (ZA) short
Shape
^\d{4}/\d{2}/\d{2}$| Value | Length | Shape |
|---|---|---|
| 2024/01/15 | 10 | matches |
| 2023/12/31 | 10 | matches |
| 2000/06/01 | 10 | matches |
| 2024/01/1 | 9 | rejected: one character short |
Background
Origin
ISO 8601 uses the hyphen as the separator between the year, month and day of a date.[1] The first edition of ISO 8601 was published as ISO 8601:1988 in June 1988.[1] In ISO 8601, a solidus, /, is usually the designator that separates the two values of a time interval.[1]
Wikipedia's article on Japanese date notation says the most commonly used date format in Japan is year, month, day, followed by the weekday.[2] Wikipedia's article on Japanese date notation shows the Gregorian all-numeric date in Japan written year/month/day with slashes.[2] Unicode's CLDR locale data gives y/MM/dd as both the short and the medium Gregorian date pattern for Japanese (ja).[3] CLDR gives y/MM/dd as the short Gregorian date pattern for South African English (en-ZA).[4] Wikipedia's list of date formats by country gives yyyy/mm/dd as one of the English-language date formats in South Africa.[5] Wikipedia's list of date formats by country gives yyyy/(m)m/(d)d and yyyy-mm-dd as short date formats in Taiwan.[5] Wikipedia's list of date formats by country gives yyyy/mm/dd as the date format for Basque in Spain.[5] Wikipedia's list of date formats by country gives yyyy/mm/dd as the short format in Iran for dates in the Persian calendar.[5]
Use
In CLDR's date pattern language, the length of the y field specifies the minimum number of digits for the year in most cases.[6] CLDR's short Gregorian date pattern for Traditional Chinese (zh-Hant) is y/M/d.[7] Wikipedia's list of date formats by country gives (yy)yy/(m)m/(d)d, with or without leading zeroes, among the casual date forms used in China.[5] The Japanese Ministry of Health, Labour and Welfare's open-data CSV of newly confirmed COVID-19 cases writes its dates in the form 2020/1/16, without leading zeros.[8]
Python's datetime documentation notes that, when used with strptime(), the leading zero is optional for %d and %m.[9] If a column must hold strictly padded dates, check the text against a fixed ten-character pattern before casting, rather than relying on the parser to reject the short forms. (Meridian's view)
Sources
- [1]ISO 8601secondary source
- [2]Date and time notation in Japansecondary source
- [3]cldr-json: cldr-dates-full/main/ja/ca-gregorian.jsonstandard
- [4]cldr-json: cldr-dates-full/main/en-ZA/ca-gregorian.jsonstandard
- [5]List of date formats by countrysecondary source
- [6]Unicode Locale Data Markup Language (LDML) Part 4: Datesstandard
- [7]cldr-json: cldr-dates-full/main/zh-Hant/ca-gregorian.jsonstandard
- [8]newly_confirmed_cases_daily.csvdataset
- [9]datetime — Basic date and time typesdocumentation
Detection notes
New in format coverage expansion. High prevalence in East Asian data.
Use it
$ finetype infer -i "2024/01/15" --mode column
→ datetime.date.ymd_slash
SELECT ft_infer('2024/01/15');
-- → 'datetime.date.ymd_slash'strptime({col}, '%Y/%m/%d')::DATE
-- Format: %Y/%m/%dSchema
https://meridian.online/schemas/datetime.date.ymd_slash · Frictionless type date · %Y/%m/%d
finetype taxonomy datetime.date.ymd_slash -o json-schema