From 914c7c791bea621cfc7ea7c891a6edc993264d43 Mon Sep 17 00:00:00 2001 From: Alan Liu Date: Fri, 9 May 2003 18:44:54 +0000 Subject: [PATCH] ICU-2792 fix anomalous behavior when adding across a DST boundary X-SVN-Rev: 11864 --- .../dev/test/calendar/IBMCalendarTest.java | 40 ++++++++++++++++++- icu4j/src/com/ibm/icu/util/Calendar.java | 13 ++++++ 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/icu4j/src/com/ibm/icu/dev/test/calendar/IBMCalendarTest.java b/icu4j/src/com/ibm/icu/dev/test/calendar/IBMCalendarTest.java index 778a3334080..2fc0c3c5cf4 100755 --- a/icu4j/src/com/ibm/icu/dev/test/calendar/IBMCalendarTest.java +++ b/icu4j/src/com/ibm/icu/dev/test/calendar/IBMCalendarTest.java @@ -4,8 +4,8 @@ * others. All Rights Reserved. ******************************************************************************* * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/dev/test/calendar/IBMCalendarTest.java,v $ - * $Date: 2003/04/04 17:15:13 $ - * $Revision: 1.15 $ + * $Date: 2003/05/09 18:44:53 $ + * $Revision: 1.16 $ ******************************************************************************* */ package com.ibm.icu.dev.test.calendar; @@ -411,6 +411,42 @@ public class IBMCalendarTest extends CalendarTest { } } + /** + * Make sure that when adding a day, we actually wind up in a + * different day. The DST adjustments we use to keep the hour + * constant across DST changes can backfire and change the day. + */ + public void TestTimeZoneTransitionAdd() { + Locale locale = Locale.US; // could also be CHINA + SimpleDateFormat dateFormat = + new SimpleDateFormat("MM/dd/yyyy HH:mm z", locale); + + String tz[] = TimeZone.getAvailableIDs(); + + for (int z=0; z