<i18n dev> The first year skipped when using UTC time for "jdk.calendar.sypplemental.era" system property

Mitsuru Matsushima m-matsushima at bk.jp.nec.com
Fri Jun 23 02:10:40 UTC 2017


Hi Naoto-san,

Thank you for your response.

I reported this issue to bugreport.java.com now.

---
Mitsuru


> -----Original Message-----
> From: Naoto Sato [mailto:naoto.sato at oracle.com]
> Sent: Friday, June 23, 2017 8:39 AM
> To: Matsushima Mitsuru(松島 充) <m-matsushima at bk.jp.nec.com>; i18n-dev at openjdk.java.net
> Subject: Re: <i18n dev> The first year skipped when using UTC time for "jdk.calendar.sypplemental.era" system property
> 
> Hi Matsushita-san,
> 
> I will look into it. Could you please file an issue about this?
> 
> Naoto
> 
> On 6/22/17 6:20 PM, Mitsuru Matsushima wrote:
> > Hi,
> >
> > I found an issue about "jdk.calendar.sypplemental.era" system property.
> >
> > According toJavadoc of JapaneseImperialCalendar, the system property can specify "since" parameter as UTC time.
> >
> > However, on using UTC time, the first year of new era is skipped.
> > The new era start with a second year as follow:
> >
> > NewEra2年1月1日 12:0:0.0
> > 平成30年12月31日 11:59:59.999999999
> >
> > TEST CODE:
> > =======================================
> >      public static void main(String... args) {
> >          // set supplemental era
> >          final long since = ZonedDateTime
> >                  .of(2019, 1, 1, 0, 0, 0, 0, ZoneId.of("Asia/Tokyo"))
> >                  .toInstant().toEpochMilli();
> >          System.setProperty(
> >                  "jdk.calendar.japanese.supplemental.era",
> >                  "name=NewEra,abbr=N.E,since=" + since + "u");
> >          final DateTimeFormatter fmtrFull = DateTimeFormatter.ofPattern("GGGGy年M月d日 h:m:s.n")
> >                  .withChronology(JapaneseChronology.INSTANCE)
> >                  .withLocale(new Locale("ja", "JP", "JP"));
> >          IntStream.rangeClosed(0, 1)
> >                  .mapToObj(h -> LocalDateTime.of(2019, 1, 1, 0, 0).minusNanos(h))
> >                  .map(fmtrFull::format)
> >                  .forEach(System.out::println);
> >      }
> > =======================================
> >
> > TEST ENVIRONMENT:
> > java version "9-ea"
> > Java(TM) SE Runtime Environment (build 9-ea+174) Java HotSpot(TM)
> > 64-Bit Server VM (build 9-ea+174, mixed mode)
> >
> > ---
> > Mitsuru
> >



More information about the i18n-dev mailing list