Skip to content

Chinese (zh)

Chinese locale support in whichtime.

Casual Dates

ExpressionMeaning
今天today
明天tomorrow
昨天yesterday
后天day after tomorrow
前天day before yesterday

Relative Dates

Past

ExpressionMeaning
X天前X days ago
X周前X weeks ago
X个月前X months ago
上周last week
上个月last month
去年last year

Future

ExpressionMeaning
X天后in X days
X周后in X weeks
下周next week
下个月next month
明年next year

Weekdays

ExpressionMeaning
星期一 / 周一Monday
星期二 / 周二Tuesday
星期三 / 周三Wednesday
星期四 / 周四Thursday
星期五 / 周五Friday
星期六 / 周六Saturday
星期日 / 周日Sunday
下周一next Monday

Date Formats

Chinese uses YYYY/MM/DD format:

FormatExample
YYYY年MM月DD日2024年12月25日
YYYY/MM/DD2024/12/25
MM月DD日12月25日

Time Expressions

ExpressionTime
15点15:00
15点30分15:30
下午3点15:00 (3pm)
上午9点09:00 (9am)
中午noon
午夜midnight
早上morning
下午afternoon
晚上evening

Examples

python
from whichtime import parse_with_locale, WhichTimeLocale

# Casual
parse_with_locale("今天", WhichTimeLocale.ZH)
parse_with_locale("明天", WhichTimeLocale.ZH)

# Relative
parse_with_locale("2天后", WhichTimeLocale.ZH)
parse_with_locale("3周前", WhichTimeLocale.ZH)

# Combined
parse_with_locale("明天下午3点", WhichTimeLocale.ZH)
parse_with_locale("下周一", WhichTimeLocale.ZH)

# Date formats
parse_with_locale("2024年12月25日", WhichTimeLocale.ZH)
parse_with_locale("12月25日", WhichTimeLocale.ZH)

Released under the MIT License.