Meridianmeridian

Chinese Standard Date

datetime.date.chinese_ymd

Year-Month-Day with Chinese character delimiters. Standard in Chinese government, institutional data, and formal documents. Uses Unicode characters for year, month, day markers.

Domain
datetime
Category
date
Casts to
DATE
Scope
Universal

Try it

CLI
$ finetype infer -i "2024年1月15日"
→ datetime.date.chinese_ymd

DuckDB

Detect
SELECT finetype('2024年1月15日');
-- → 'datetime.date.chinese_ymd'
Cast expression
strptime(regexp_replace(regexp_replace(regexp_replace({col}, '年', '-'), '月', '-'), '日', ''), '%Y-%-m-%-d')::DATE
Safe cast pipeline
-- Normalise and cast in one step
SELECT TRY_CAST(finetype_cast(my_column) AS DATE) AS clean_value
FROM my_table
WHERE finetype(my_column) = 'datetime.date.chinese_ymd';

JSON Schema

finetype schema datetime.date.chinese_ymd
{
  "$id": "https://meridian.online/schemas/datetime.date.chinese_ymd",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "Year-Month-Day with Chinese character delimiters. Standard in Chinese government, institutional data, and formal documents. Uses Unicode characters for year, month, day markers.",
  "examples": [
    "2024年1月15日",
    "2023年12月25日",
    "2022年6月1日"
  ],
  "pattern": "^\\d{4}年[1-9]\\d?月[1-3]?\\d日$",
  "title": "Chinese Standard Date",
  "type": "string",
  "x-finetype-broad-type": "DATE",
  "x-finetype-transform": "strptime(regexp_replace(regexp_replace(regexp_replace({col}, '年', '-'), '月', '-'), '日', ''), '%Y-%-m-%-d')::DATE"
}

Examples

2024年1月15日2023年12月25日2022年6月1日

Aliases

cn_standard