Package java.util

Examples of java.util.SimpleTimeZone.inDaylightTime()


    // Spec indicates that both end and start must be set or result is
    // undefined
    st.setStartRule(Calendar.NOVEMBER, 1, Calendar.SUNDAY, 1, true);
    st.setEndRule(Calendar.NOVEMBER, 15, Calendar.SUNDAY, 1, false);
    assertTrue("StartRule improperly set1", st.useDaylightTime());
    assertTrue("StartRule improperly set2", st
        .inDaylightTime((new GregorianCalendar(1999, Calendar.NOVEMBER,
            7, 12, 0).getTime())));
    assertTrue("StartRule improperly set3", st
        .inDaylightTime((new GregorianCalendar(1999, Calendar.NOVEMBER,
            13, 12, 0).getTime())));
View Full Code Here


    st.setEndRule(Calendar.NOVEMBER, 15, Calendar.SUNDAY, 1, false);
    assertTrue("StartRule improperly set1", st.useDaylightTime());
    assertTrue("StartRule improperly set2", st
        .inDaylightTime((new GregorianCalendar(1999, Calendar.NOVEMBER,
            7, 12, 0).getTime())));
    assertTrue("StartRule improperly set3", st
        .inDaylightTime((new GregorianCalendar(1999, Calendar.NOVEMBER,
            13, 12, 0).getTime())));
    assertTrue("StartRule improperly set4", !(st
        .inDaylightTime(new GregorianCalendar(1999, Calendar.NOVEMBER,
            6, 12, 0).getTime())));
View Full Code Here

        .inDaylightTime((new GregorianCalendar(1999, Calendar.NOVEMBER,
            7, 12, 0).getTime())));
    assertTrue("StartRule improperly set3", st
        .inDaylightTime((new GregorianCalendar(1999, Calendar.NOVEMBER,
            13, 12, 0).getTime())));
    assertTrue("StartRule improperly set4", !(st
        .inDaylightTime(new GregorianCalendar(1999, Calendar.NOVEMBER,
            6, 12, 0).getTime())));
    assertTrue("StartRule improperly set5", !(st
        .inDaylightTime(new GregorianCalendar(1999, Calendar.NOVEMBER,
            14, 12, 0).getTime())));
View Full Code Here

        .inDaylightTime((new GregorianCalendar(1999, Calendar.NOVEMBER,
            13, 12, 0).getTime())));
    assertTrue("StartRule improperly set4", !(st
        .inDaylightTime(new GregorianCalendar(1999, Calendar.NOVEMBER,
            6, 12, 0).getTime())));
    assertTrue("StartRule improperly set5", !(st
        .inDaylightTime(new GregorianCalendar(1999, Calendar.NOVEMBER,
            14, 12, 0).getTime())));
  }

  /**
 
View Full Code Here

    // Test for method void java.util.SimpleTimeZone.setStartYear(int)
    SimpleTimeZone st = new SimpleTimeZone(1000, "Test_TZ");
    st.setStartRule(Calendar.NOVEMBER, 1, Calendar.SUNDAY, 0);
    st.setEndRule(Calendar.NOVEMBER, -1, Calendar.SUNDAY, 0);
    st.setStartYear(1999);
    assertTrue("set year improperly set1", !(st
        .inDaylightTime(new GregorianCalendar(1999, Calendar.JULY, 12)
            .getTime())));
    assertTrue("set year improperly set2", !(st
        .inDaylightTime(new GregorianCalendar(1998, Calendar.OCTOBER,
            13).getTime())));
View Full Code Here

    st.setEndRule(Calendar.NOVEMBER, -1, Calendar.SUNDAY, 0);
    st.setStartYear(1999);
    assertTrue("set year improperly set1", !(st
        .inDaylightTime(new GregorianCalendar(1999, Calendar.JULY, 12)
            .getTime())));
    assertTrue("set year improperly set2", !(st
        .inDaylightTime(new GregorianCalendar(1998, Calendar.OCTOBER,
            13).getTime())));
    assertTrue("set year improperly set3", (st
        .inDaylightTime(new GregorianCalendar(1999, Calendar.NOVEMBER,
            13).getTime())));
View Full Code Here

        .inDaylightTime(new GregorianCalendar(1999, Calendar.JULY, 12)
            .getTime())));
    assertTrue("set year improperly set2", !(st
        .inDaylightTime(new GregorianCalendar(1998, Calendar.OCTOBER,
            13).getTime())));
    assertTrue("set year improperly set3", (st
        .inDaylightTime(new GregorianCalendar(1999, Calendar.NOVEMBER,
            13).getTime())));
  }

  /**
 
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.