Examples of ZoneOffset


Examples of org.threeten.bp.ZoneOffset

        //        Rule    EU      1981    max -   Mar lastSun  1:00u  1:00    S
        //        Rule    EU      1996    max -   Oct lastSun  1:00u  0   -
        //        Zone    Europe/Sofia
        //        2:00    E-Eur   EE%sT   1997
        //        2:00    EU      EE%sT
          ZoneOffset plus2 = ZoneOffset.ofHours(2);
          ZoneOffset plus3 = ZoneOffset.ofHours(3);
          ZoneRulesBuilder b = new ZoneRulesBuilder();
          b.addWindow(plus2, dateTime(1997, 1, 1, 0, 0), WALL);
          b.addRuleToWindow(1996, Year.MAX_VALUE, MARCH, -1, SUNDAY, time(1, 0), false, WALL, PERIOD_1HOUR);
          b.addRuleToWindow(1996, Year.MAX_VALUE, OCTOBER, -1, SUNDAY, time(1, 0), false, WALL, PERIOD_0);
          b.addWindowForever(plus2);
View Full Code Here

Examples of org.threeten.bp.ZoneOffset

        //    Zone    Europe/Prague   0:57:44 -     LMT   1850
        //                            0:57:44 -     PMT   1891 Oct
        //                            1:00    C-Eur CE%sT 1944 Sep 17 2:00s
        //                            1:00    Czech CE%sT 1979
        //                            1:00    EU    CE%sT
        ZoneOffset plus1 = ZoneOffset.ofHours(1);
        ZoneOffset plus2 = ZoneOffset.ofHours(2);
        ZoneRulesBuilder b = new ZoneRulesBuilder();
        b.addWindow(plus1, dateTime(1944, 9, 17, 2, 0), STANDARD);
        b.addRuleToWindow(1944, 1945, APRIL, 1, MONDAY, time(2, 0), false, STANDARD, PERIOD_1HOUR);
        b.addRuleToWindow(1944, OCTOBER, 2, time(2, 0), false, STANDARD, PERIOD_0);
        b.addRuleToWindow(1945, SEPTEMBER, 16, time(2, 0), false, STANDARD, PERIOD_0);
View Full Code Here

Examples of org.threeten.bp.ZoneOffset

        //    4:00 E-EurAsia  GE%sT   1996 Oct lastSun
        //    4:00    1:00    GEST    1997 Mar lastSun
        //    4:00 E-EurAsia  GE%sT   2004 Jun 27
        //    3:00 RussiaAsia GE%sT   2005 Mar lastSun 2:00
        //    4:00    -   GET
        ZoneOffset plus4 = ZoneOffset.ofHours(4);
        ZoneOffset plus5 = ZoneOffset.ofHours(5);
        ZoneRulesBuilder b = new ZoneRulesBuilder();
        b.addWindow(plus4, dateTime(1996, 10, 27, 0, 0), WALL);
        b.addRuleToWindow(1996, Year.MAX_VALUE, MARCH, -1, SUNDAY, time(0, 0), false, WALL, PERIOD_1HOUR);
        b.addRuleToWindow(1996, Year.MAX_VALUE, OCTOBER, -1, SUNDAY, time(0, 0), false, WALL, PERIOD_0);
        b.addWindow(plus4, dateTime(1997, 3, 30, 0, 0), WALL);
View Full Code Here

Examples of org.threeten.bp.ZoneOffset

        //        Rule    US  2007  max  -   Mar Sun>=8  2:00  1:00  D
        //        Rule    US  2007  max  -   Nov Sun>=1  2:00  0     S
        //    -5:00   -   EST 2006 Apr  2 2:00
        //    -6:00   US  C%sT    2007 Nov  4 2:00
        //    -5:00   US  E%sT
        ZoneOffset minus5 = ZoneOffset.ofHours(-5);
        ZoneOffset minus6 = ZoneOffset.ofHours(-6);
        ZoneRulesBuilder b = new ZoneRulesBuilder();
        b.addWindow(minus6, dateTime(2007, 11, 4, 2, 0), WALL);
        b.addRuleToWindow(2007, Year.MAX_VALUE, MARCH, 8, SUNDAY, time(2, 0), false, WALL, PERIOD_1HOUR);
        b.addRuleToWindow(2007, Year.MAX_VALUE, NOVEMBER, 1, SUNDAY, time(2, 0), false, WALL, PERIOD_0);
        b.addWindowForever(minus5);
View Full Code Here

Examples of org.threeten.bp.ZoneOffset

        //      Rule    Canada  1974   2006 -   Oct lastSun 2:00    0     S
        //      Rule    NT_YK   1987   2006 -   Apr Sun>=1  2:00    1:00  D
        //      Rule    NT_YK   1980   2006 -   Oct lastSun 2:00    0     S
        //                    -5:00   NT_YK   E%sT    1999 Oct 31 2:00
        //                    -6:00   Canada  C%sT
        ZoneOffset minus4 = ZoneOffset.ofHours(-4);
        ZoneOffset minus5 = ZoneOffset.ofHours(-5);
        ZoneOffset minus6 = ZoneOffset.ofHours(-6);
        ZoneRulesBuilder b = new ZoneRulesBuilder();
        b.addWindow(minus5, dateTime(1999, 10, 31, 2, 0), WALL);
        b.addRuleToWindow(1987, Year.MAX_VALUE, APRIL, 1, SUNDAY, time(2, 0), false, WALL, PERIOD_1HOUR);
        b.addRuleToWindow(1987, Year.MAX_VALUE, OCTOBER, -1, SUNDAY, time(2, 0), false, WALL, PERIOD_0);
        b.addWindowForever(minus6);
View Full Code Here

Examples of org.threeten.bp.ZoneOffset

        // rule is 24:00 - this is simplified from the TZDB
        //    Rule    Jordan  2002    max -   Mar lastThu 24:00   1:00    S
        //    Rule    Jordan  2002    max -   Sep lastFri 0:00s   0   -
        //    # Zone  NAME        GMTOFF  RULES   FORMAT  [UNTIL]
        //                2:00    Jordan  EE%sT
        ZoneOffset plus2 = ZoneOffset.ofHours(2);
        ZoneOffset plus3 = ZoneOffset.ofHours(3);
        ZoneRulesBuilder b = new ZoneRulesBuilder();
        b.addWindowForever(plus2);
        b.addRuleToWindow(2002, Year.MAX_VALUE, MARCH, -1, THURSDAY, time(0, 0), true, WALL, PERIOD_1HOUR);
        b.addRuleToWindow(2002, Year.MAX_VALUE, SEPTEMBER, -1, FRIDAY, time(0, 0), false, STANDARD, PERIOD_0);
        ZoneRules test = b.toRules("Asia/Amman");
View Full Code Here

Examples of org.threeten.bp.ZoneOffset

        this.lastRules = lastRules;

        // convert savings transitions to locals
        List<LocalDateTime> localTransitionList = new ArrayList<LocalDateTime>();
        for (int i = 0; i < savingsInstantTransitions.length; i++) {
            ZoneOffset before = wallOffsets[i];
            ZoneOffset after = wallOffsets[i + 1];
            ZoneOffsetTransition trans = new ZoneOffsetTransition(savingsInstantTransitions[i], before, after);
            if (trans.isGap()) {
                localTransitionList.add(trans.getDateTimeBefore());
                localTransitionList.add(trans.getDateTimeAfter());
            } else {
View Full Code Here

Examples of org.threeten.bp.ZoneOffset

        }
        if ((index & 1) == 0) {
            // gap or overlap
            LocalDateTime dtBefore = savingsLocalTransitions[index];
            LocalDateTime dtAfter = savingsLocalTransitions[index + 1];
            ZoneOffset offsetBefore = wallOffsets[index / 2];
            ZoneOffset offsetAfter = wallOffsets[index / 2 + 1];
            if (offsetAfter.getTotalSeconds() > offsetBefore.getTotalSeconds()) {
                // gap
                return new ZoneOffsetTransition(dtBefore, offsetBefore, offsetAfter);
            } else {
                // overlap
                return new ZoneOffsetTransition(dtAfter, offsetBefore, offsetAfter);
View Full Code Here

Examples of org.threeten.bp.ZoneOffset

        return standardOffsets[index + 1];
    }

    @Override
    public Duration getDaylightSavings(Instant instant) {
        ZoneOffset standardOffset = getStandardOffset(instant);
        ZoneOffset actualOffset = getOffset(instant);
        return Duration.ofSeconds(actualOffset.getTotalSeconds() - standardOffset.getTotalSeconds());
    }
View Full Code Here

Examples of org.threeten.bp.ZoneOffset

        // check if using last rules
        long lastHistoric = savingsInstantTransitions[savingsInstantTransitions.length - 1];
        if (lastRules.length > 0 && epochSec > lastHistoric) {
            // search year the instant is in
            ZoneOffset lastHistoricOffset = wallOffsets[wallOffsets.length - 1];
            int year = findYear(epochSec, lastHistoricOffset);
            ZoneOffsetTransition[] transArray = findTransitionArray(year);
            for (int i = transArray.length - 1; i >= 0; i--) {
                if (epochSec > transArray[i].toEpochSecond()) {
                    return transArray[i];
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.