Java(JRE)カレンダー和暦(令和対応)について
JDK8(Oracle JDK 8u211以前)を使用していてハマったので備忘録。
$ echo 令和 | native2ascii \u4ee4\u548c
この値と令和の省略文字"R"、JST時間2019年5月1日9:00(GMT2019年5月1日0:00)のミリ秒(1556668800000)を jre/lib/calendars.propertiesに追記。
$ cat ${JAVA_HOME}/jre/lib/calendars.properties .... calendar.japanese.eras: \ name=Meiji,abbr=M,since=-3218832000000; \ name=Taisho,abbr=T,since=-1812153600000; \ name=Showa,abbr=S,since=-1357603200000; \ name=Heisei,abbr=H,since=600220800000; \ name=\u4ee4\u548c,abbr=R,since=1556668800000 ....
以下のサイトが秀逸。