Bug 24453 - Producing alternative representation for year with alternative numeric symbols
Summary: Producing alternative representation for year with alternative numeric symbols
Status: NEW
Alias: None
Product: glibc
Classification: Unclassified
Component: time (show other bugs)
Version: 2.29
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-14 06:24 UTC by TAMUKI Shoichi
Modified: 2019-04-19 02:51 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description TAMUKI Shoichi 2019-04-14 06:24:51 UTC
In Japanese locale, it is possible to produce Japanese calendar date
and time representation with Chinese numerals as follows:

$ LANG=ja_JP.UTF-8 date -d "2019-04-14 11:23:31" +"%m月%d日"
04月14日
$ LANG=ja_JP.UTF-8 date -d "2019-04-14 11:23:31" +"%H時%M分%S秒"
11時23分31秒

$ LANG=ja_JP.UTF-8 date -d "2019-04-14 11:23:31" +"%Om月%Od日"
四月十四日
$ LANG=ja_JP.UTF-8 date -d "2019-04-14 11:23:31" +"%OH時%OM分%OS秒"
十一時二十三分三十一秒

These representation are very commonly used in Japan, especially in
vertical writing.

However, Japanese calendar year can currently not be produced using
Chinese numeric symbols, because both the 'E' and 'O' modifiers can
not be applied to "%y" or "%Y" simultaneously:

$ LANG=ja_JP.UTF-8 date -d "2019-04-14 11:23:31" +"%y年"
19年
$ LANG=ja_JP.UTF-8 date -d "2019-04-14 11:23:31" +"%Y年"
2019年
$ LANG=ja_JP.UTF-8 date -d "2019-04-14 11:23:31" +"%EC%Ey年"
平成31年
$ LANG=ja_JP.UTF-8 date -d "2019-04-14 11:23:31" +"%EY"
平成31年
$ LANG=ja_JP.UTF-8 date -d "2019-04-14 11:23:31" +"%Oy年"
十九年
$ LANG=ja_JP.UTF-8 date -d "2019-04-14 11:23:31" +"%EC%OEy年"
平成%OEy年
$ LANG=ja_JP.UTF-8 date -d "2019-04-14 11:23:31" +"%OEY"
%OEY

The last two should be represented as follows:

平成三十一年
Comment 1 TAMUKI Shoichi 2019-04-17 08:32:03 UTC
I sent the patch to libc-alpha:
https://sourceware.org/ml/libc-alpha/2019-04/msg00395.html
Comment 2 TAMUKI Shoichi 2019-04-19 02:51:09 UTC
I sent the patch v2 to libc-alpha:
https://sourceware.org/ml/libc-alpha/2019-04/msg00476.html