obtain the maximum era with ucal_getLimit in japanese calendar seems ignore the local timezone
the new era anticipated to begin on 1 May 2019, this means ucal_getLimit should return the new era type index at 1 May 2019. suppose the code running under the Japanese time zone, the new era will only appear at 2019-05-01 00:00:00 (UTC) Instead of 2019-05-01 00:00:00 (JST). this means the new era will not take effect until 9:00(AM) Japan time.
The following code can reproduce this issue:
Associated: Fix Getting Max Japanese Era
I suspect the issue is because the API ucal_getLimit eventually uses the API ucal_getNow to determine the “current” time, which according to the documentation:
Returns the current UTC (GMT) time measured in milliseconds since 0:00:00 on 1/1/70 (derived from the system time).
I wonder if perhaps this code in erarules.cpp could be changed to get the current time using ICU’s default time zone instead?
Hello and ,
I pushed some changes to a branch in my fork to modify the Japanese Calendar current era calculation so that it uses the default ICU time zone instead of using UTC.
However, this is only for ICU4C. If this seems okay, then could somebody help me with the similar change on the ICU4J implementation?
I'm stealing this ticket from you and assigning to me.