ICU4J Calendar handles ambiguous local time differently from Java

Description

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.

Activity

Show:
TracBot
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 - http://bugs.icu-project.org/trac/ticket/5812 - 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 http://source.icu-project.org/trac/browser/icu/trunk/source/test/intltest/dtfmttst.cpp#L1749
      7. Do we want to -

      1.  

        1.  

          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.

TracBot
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.

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

[Восточные танцы музыка скачать бесплатно|http://art-dance.com.ua/]

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

we know <a href="http://www.newpaulsmith.com/">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="http://www.newpaulsmith.com/">Paul Smith</A> shoes, <a href="http://www.newpaulsmith.com/paul-smith-sweaters-c-526.html">Paul Smith women’s clothing</a>, <a href="http://www.newpaulsmith.com/paul-smith-sweaters-c-526.html">Paul Smith Swimwear</a>, and Paul Smith socks.

Fixed

Assignee

Yoshito Umaoka

Reporter

Yoshito Umaoka

Components

Labels

None

Reviewer

None

Priority

major

Time Needed

Days

Fix versions