Code example for SimpleTimeZone

Methods: clone, inDaylightTime, setStartYear

0
 
    // http://code.google.com/p/android/issues/detail?id=11542 
    public void test_clone_SimpleTimeZone() { 
        SimpleTimeZone stz = new SimpleTimeZone(21600000, "Central Standard Time");
        stz.setStartYear(1000);
        stz.inDaylightTime(new Date());
        stz.clone();
    } 
 
    // http://b/3049014 
    public void testCustomTimeZoneDisplayNames() { 
        TimeZone tz0001 = new SimpleTimeZone(60000, "ONE MINUTE");
        TimeZone tz0130 = new SimpleTimeZone(5400000, "ONE HOUR, THIRTY");
        TimeZone tzMinus0130 = new SimpleTimeZone(-5400000, "NEG ONE HOUR, THIRTY");
        assertEquals("GMT+00:01", tz0001.getDisplayName(false, TimeZone.SHORT, Locale.US));
        assertEquals("GMT+01:30", tz0130.getDisplayName(false, TimeZone.SHORT, Locale.US));
        assertEquals("GMT-01:30", tzMinus0130.getDisplayName(false, TimeZone.SHORT, Locale.US));
    } 
 
    // http://code.google.com/p/android/issues/detail?id=14395 
    public void testPreHistoricInDaylightTime() throws Exception {