Package com.ibm.icu.util

Examples of com.ibm.icu.util.TimeZoneTransition


                if (cal.get(Calendar.DST_OFFSET) == 0) {
                    useStandard = true;
                    // Check if the zone actually uses daylight saving time around the time
                    if (tz instanceof BasicTimeZone) {
                        BasicTimeZone btz = (BasicTimeZone)tz;
                        TimeZoneTransition before = btz.getPreviousTransition(time, true);
                        if (before != null
                                && (time - before.getTime() < DST_CHECK_RANGE)
                                && before.getFrom().getDSTSavings() != 0) {
                            useStandard = false;
                        } else {
                            TimeZoneTransition after = btz.getNextTransition(time, false);
                            if (after != null
                                    && (after.getTime() - time < DST_CHECK_RANGE)
                                    && after.getTo().getDSTSavings() != 0) {
                                useStandard = false;
                            }
                        }
                    } else {
                        // If not BasicTimeZone... only if the instance is not an ICU's implementation.
View Full Code Here


          } else { // tztype == TZTYPE_DST
            if (offsets[1] == 0) {
              if (btz != null) {
                long time = localMillis + offsets[0];
                // We use the nearest daylight saving time rule.
                TimeZoneTransition beforeTrs, afterTrs;
                long beforeT = time, afterT = time;
                int beforeSav = 0, afterSav = 0;

                // Search for DST rule before or on the time
                while (true) {
                  beforeTrs = btz.getPreviousTransition(beforeT, true);
                  if (beforeTrs == null) {
                    break;
                  }
                  beforeT = beforeTrs.getTime() - 1;
                  beforeSav = beforeTrs.getFrom().getDSTSavings();
                  if (beforeSav != 0) {
                    break;
                  }
                }
View Full Code Here

TOP

Related Classes of com.ibm.icu.util.TimeZoneTransition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.