Package com.ibm.icu.util

Examples of com.ibm.icu.util.TimeZone.useDaylightTime()


        logln("The timezone is " + time_zone.getID());

        if (time_zone.inDaylightTime(d) != true)
            errln("FAIL: inDaylightTime returned false");

        if (time_zone.useDaylightTime() != true)
            errln("FAIL: useDaylightTime returned false");

        if (time_zone.getRawOffset() != -8*millisPerHour)
            errln( "FAIL: getRawOffset returned wrong value");

View Full Code Here


            boolean fdy = ftz.useDaylightTime();

            String cdn = ctz.getDisplayName();
            long cro = ctz.getRawOffset();
            long cds = ctz.getDSTSavings();
            boolean cdy = ctz.useDaylightTime();

            if (!fdn.equals(cdn)) {
                logln("display name (" + funkyName + ", " + correctName + ") expected: " + cdn + " but got: " + fdn);
            } else if (fro != cro) {
                logln("offset (" + funkyName + ", " + correctName + ") expected: " + cro + " but got: " + fro);
View Full Code Here

                GregorianCalendar cal = new GregorianCalendar(zone);
                cal.clear();
                cal.set(1900, 15, 5, 5, 8, 13);
                if (cal.get(Calendar.HOUR) != 5) {
                    logln("Fail: " + zone.getID() + " " +
                          zone.useDaylightTime() + "; DST_OFFSET = " +
                          cal.get(Calendar.DST_OFFSET) / (60*60*1000.0) + "; ZONE_OFFSET = " +
                          cal.get(Calendar.ZONE_OFFSET) / (60*60*1000.0) + "; getRawOffset() = " +
                          zone.getRawOffset() / (60*60*1000.0) +
                          "; HOUR = " + cal.get(Calendar.HOUR));
                    cal.clear();
View Full Code Here

                          "; HOUR = " + cal.get(Calendar.HOUR));
                    cal.clear();
                    cal.set(1900, 15, 5, 5, 8, 13);
                    if (cal.get(Calendar.HOUR) != 5) {
                        logln("Fail: " + zone.getID() + " " +
                              zone.useDaylightTime() + "; DST_OFFSET = " +
                              cal.get(Calendar.DST_OFFSET) / (60*60*1000.0) + "; ZONE_OFFSET = " +
                              cal.get(Calendar.ZONE_OFFSET) / (60*60*1000.0) + "; getRawOffset() = " +
                              zone.getRawOffset() / (60*60*1000.0) +
                              "; HOUR = " + cal.get(Calendar.HOUR));
                        cal.clear();
View Full Code Here

                        java.util.GregorianCalendar cal2 = new java.util.GregorianCalendar(java.util.TimeZone.getTimeZone(ids[i]));
                        cal2.clear();
                        cal2.set(1900, 15, 5, 5, 8, 13);
                        cal2.get(Calendar.HOUR);
                        logln("java.util.GC: " + zone.getID() + " " +
                            zone.useDaylightTime() + "; DST_OFFSET = " +
                            cal2.get(Calendar.DST_OFFSET) / (60*60*1000.0) + "; ZONE_OFFSET = " +
                            cal2.get(Calendar.ZONE_OFFSET) / (60*60*1000.0) + "; getRawOffset() = " +
                            zone.getRawOffset() / (60*60*1000.0) +
                            "; HOUR = " + cal.get(Calendar.HOUR));
                        logln("ms = " + cal2.getTime() + " (" + cal2.getTime().getTime() + ")");
View Full Code Here

                            "; HOUR = " + cal.get(Calendar.HOUR));
                        logln("ms = " + cal2.getTime() + " (" + cal2.getTime().getTime() + ")");
                        bad = true;
                    } else if (false) { // Change to true to debug
                        logln("OK: " + zone.getID() + " " +
                              zone.useDaylightTime() + " " +
                              cal.get(Calendar.DST_OFFSET) / (60*60*1000) + " " +
                              zone.getRawOffset() / (60*60*1000) +
                              ": HOUR = " + cal.get(Calendar.HOUR));
                    }
                }
View Full Code Here

    /*
     * Test method for 'com.ibm.icu.util.TimeZone.useDaylightTime()'
     */
    public void testUseDaylightTime() {
        TimeZone tz = TimeZone.getTimeZone("PST");
        assertTrue(tz.useDaylightTime());
    }

    /*
     * Test method for 'com.ibm.icu.util.TimeZone.inDaylightTime(Date)'
     */
 
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.