Chinese Standard Date
datetime.date.chinese_ymdYear-Month-Day with Chinese character delimiters. Standard in Chinese government, institutional data, and formal documents. Uses Unicode characters for year, month, day markers.
Worked samples
DuckDB 1.5.5 · finetype 0.6.64
| Value | As DATE |
|---|---|
| 2024年1月15日 | 2024-01-15 |
| 2023年12月25日 | 2023-12-25 |
| 2022年6月1日 | 2022-06-01 |
Shape
^\d{4}年[1-9]\d?月[1-3]?\d日$| Value | Length | Shape |
|---|---|---|
| 2024年1月15日 | 10 | matches |
| 2023年12月25日 | 11 | matches |
| 2022年6月1日 | 9 | matches |
| 2024年1月15 | 9 | rejected: one character short |
Background
Origin
GB/T 9704—2012, 党政机关公文格式 (Layout key for official document of Party and government organs), is a national standard of the People's Republic of China that replaces GB/T 9704—1999.[1] GB/T 9704—2012 was published on 2012-06-29 and took effect on 2012-07-01.[1] GB/T 9704—2012 was issued by 中华人民共和国国家质量监督检验检疫总局 and 中国国家标准化管理委员会.[1] For the date an official document is written (成文日期), GB/T 9704—2012 requires the year, month and day to be written out in Arabic numerals, with the year in full.[1]
Use
In the Unicode CLDR locale data for Chinese (zh), the long and medium Gregorian date patterns are both y年M月d日.[2] In the Unicode CLDR locale data for Traditional Chinese (zh-Hant), the long Gregorian date pattern is y年M月d日.[3] In the Unicode CLDR locale data for Japanese (ja), the long Gregorian date pattern is also y年M月d日.[4]
Where you'll meet it
On gov.cn, the closing date line of the State Council General Office's opinion 国办发〔2024〕1号 is written 2024年1月11日, without padding.[5]
Sources
- [1]GB/T 9704—2012 党政机关公文格式standard
- [2]cldr-json/cldr-dates-full/main/zh/ca-gregorian.jsonstandard
- [3]cldr-json/cldr-dates-full/main/zh-Hant/ca-gregorian.jsonstandard
- [4]cldr-json/cldr-dates-full/main/ja/ca-gregorian.jsonstandard
- [5]国务院办公厅关于发展银发经济增进老年人福祉的意见_其他_中国政府网organisation
Detection notes
New in format coverage expansion. Chinese standard date with Unicode delimiters. Transform strips Chinese characters and parses as ISO-like.
Use it
$ finetype infer -i "2024年1月15日" --mode column
→ datetime.date.chinese_ymd
SELECT ft_infer('2024年1月15日');
-- → 'datetime.date.chinese_ymd'strptime(regexp_replace(regexp_replace(regexp_replace({col}, '年', '-'), '月', '-'), '日', ''), '%Y-%-m-%-d')::DATESchema
https://meridian.online/schemas/datetime.date.chinese_ymd · Frictionless type string
finetype taxonomy datetime.date.chinese_ymd -o json-schema