Package com.ibm.icu.util

Examples of com.ibm.icu.util.TimeZone


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


    /*
     * Test method for 'com.ibm.icu.util.TimeZone.inDaylightTime(Date)'
     */
    public void testInDaylightTime() {
        TimeZone tz = TimeZone.getTimeZone("PST");
        Calendar cal = Calendar.getInstance();
        cal.set(2005, 0, 17);
        Date date = cal.getTime();
        assertFalse(tz.inDaylightTime(date));
        cal.set(2005, 6, 17);
        date = cal.getTime();
        assertTrue(tz.inDaylightTime(date));
    }
View Full Code Here

    /*
     * Test method for 'com.ibm.icu.util.TimeZone.getDefault()'
     */
    public void testGetDefault() {
        TimeZone tz = TimeZone.getDefault();
        assertNotNull(tz);
    }
View Full Code Here

    /*
     * Test method for 'com.ibm.icu.util.TimeZone.setDefault(TimeZone)'
     */
    public void testSetDefault() {
        TimeZone tz1 = TimeZone.getDefault();
        String newCode = "PDT".equals(tz1.getID()) ? "CST" : "PDT";
        TimeZone tz2 = TimeZone.getTimeZone(newCode);
        TimeZone.setDefault(tz2);
        TimeZone result = TimeZone.getDefault();
        assertNotEqual(tz1, result);
        assertEquals(tz2, result);
    }
View Full Code Here

    /*
     * Test method for 'com.ibm.icu.util.TimeZone.hasSameRules(TimeZone)'
     */
    public void testHasSameRules() {
        TimeZone tz1 = TimeZone.getTimeZone("PST");
        TimeZone tz2 = TimeZone.getTimeZone("America/Los_Angeles");
        assertTrue(tz1.hasSameRules(tz2));
    }
View Full Code Here

    /*
     * Test method for 'com.ibm.icu.util.Calendar.getInstance(TimeZone)'
     */
    public void testGetInstanceTimeZone() {
        TimeZone tz = TimeZone.getTimeZone("America/Los_Angeles");
        Calendar cal = Calendar.getInstance(tz);
        assertNotNull(cal);
        assertNotNull(cal.getTime());
        assertEquals(tz, cal.getTimeZone());
    }
View Full Code Here

    /*
     * Test method for 'com.ibm.icu.util.Calendar.getInstance(TimeZone, Locale)'
     */
    public void testGetInstanceTimeZoneLocale() {
        TimeZone tz = TimeZone.getTimeZone("America/New_York");
        Calendar cal = Calendar.getInstance(tz, Locale.US);
        assertNotNull(cal);
        assertNotNull(cal.getTime());
    }
View Full Code Here

    /*
     * Test method for 'com.ibm.icu.util.Calendar.getInstance(TimeZone, ULocale)'
     */
    public void testGetInstanceTimeZoneULocale() {
        TimeZone tz = TimeZone.getTimeZone("America/New_York");
        Calendar cal = Calendar.getInstance(tz, ULocale.US);
        assertNotNull(cal);
        assertNotNull(cal.getTime());
    }
View Full Code Here

    /*
     * Test method for 'com.ibm.icu.util.Calendar.setTimeZone(TimeZone)'
     */
    public void testSetTimeZone() {
        Calendar cal = Calendar.getInstance();
        TimeZone value1 = cal.getTimeZone();
        String tzn = "PDT".equals(value1.getID()) ? "CST" : "PDT";
        TimeZone value2 = TimeZone.getTimeZone(tzn);
        cal.setTimeZone(value2);
        TimeZone result = cal.getTimeZone();
        assertNotEqual(value1, result);
        assertEquals(value2, result);
    }
View Full Code Here

          continue;
        }
      }
      if (rawOffset != null) {
        // This is VERY inefficient.
        TimeZone z = getSystemTimeZone(id);
        if (z == null || !rawOffset.equals(z.getRawOffset())) {
          continue;
        }
      }
      result.add(id);
    }
View Full Code Here

TOP

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

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.