ICU4J Calendar handles ambiguous local time differently from Java


At DST onset, the local time jumps forward. A time falls into this hole is ambiguous. With Sun Java Calendar implementation, the ambiguous time is interpreted as local standard time. For example, March 11, 2007 2:30AM in US Eastern time is interpreted as March 11, 2007 3:30AM EDT. However, ICU4J implementation interprets it as March 11, 2007 1:30 EST. The following code snipet illustrates the issue. This problem is also reproduced with ICU4C.


July 1, 2018, 12:06 AM
Trac Comment 1 by —2007-08-15T18:41:41.000Z

In Aug 15, 2007 ICU core project meeting, we agreed to fix this after 3.8 release.

  1. Ambiguous local time at DST onset (yoshito)

    1. Input to Calendar or to DateFormat parsing: 2007-03-11 2:30AM PT is interpreted as 2007-03-11 1:30AM PST

      2. Incompatible with Java - - Java gives 2007-03-11 3:30AM PDT

      3. TimeZone#getOffset(long date, boolean local, int[] offsets) is used in Calendar implementation

      4. When date = <local milliseconds for 2007-03-11 2:30AM>, local = true, getOffset returns raw = <-8 hr> and dstsavings = <1 hr>. So getOffset for 2007-03-11 2:30AM in PT is in DST.

      5. date+offsets[0]+offsets[1] != UTC. If getOffset returns raw = <-8 hr> and dstsavigs = <0 hr>, then date+offsets[0]+offsets[1] == UTC is always true and Calender should work like Java.

      6. Same in ICU4C. See test cases showing ICU's behavior in
      7. Do we want to -



          1. change the calendar behavior and make it compatible with Java?

            2. change the behavior of getOffset(long, boolean, int[]) [is not parallel with the JDK|this] or to add a new API to support the behavior (could be yet another option in the API which Markus recently proposed for ambiguous time support)?

            8. Consensus to make Calendar and DateFormat parsing behavior consistent with Java.

            9. We should check Olson localtime() behavior.

            ##. Consensus that getOffset() and Calendar should agree on whether a point in time is DST. As result, don't change getOffset().

            ##. Yoshito and Markus should revisit the recent getOffset() proposal and consider documentation or additional API (enum) to address the spring-forward non-existent times.

            ##. Fix Calendar after ICU 3.8.

July 1, 2018, 12:06 AM
Trac Comment 4 by —2007-11-28T21:24:13.000Z

The behavior was updated in both ICU4J and ICU4C. The fix was merged as a part of #5990.

July 1, 2018, 12:06 AM
Trac Comment 6 by anonymous—2009-12-02T09:57:07.000Z

[Восточные танцы музыка скачать бесплатно|]

July 1, 2018, 12:06 AM
Trac Comment 7 by kareem198625@d30663cb0bed6080—2009-12-03T08:33:44.000Z

we know <a href="">Paul Smith</a> has an ability to anticipate and even spark off trends, not only in fashion, but in the wider context of popular culture. Paul Smith manages to transmit a genuine sense of humor and mischief mixed with his love of tradition and the classics. This is evident in the overall look of both <A href="">Paul Smith</A> shoes, <a href="">Paul Smith women’s clothing</a>, <a href="">Paul Smith Swimwear</a>, and Paul Smith socks.



Yoshito Umaoka


Yoshito Umaoka








Time Needed


Fix versions