Code example for SimpleTimeZone

Methods: inDaylightTimesetEndRulesetStartRuleuseDaylightTime

	 * @tests java.util.SimpleTimeZone#setStartRule(int, int, int) 
	public void test_setStartRuleIII() { 
		// Test for method void java.util.SimpleTimeZone.setStartRule(int, int, 
		// int) 
		SimpleTimeZone st = new SimpleTimeZone(1000, "Test_TZ");
		// Spec indicates that both end and start must be set or result is 
		// undefined 
		st.setStartRule(Calendar.NOVEMBER, 1, 1);
		st.setEndRule(Calendar.DECEMBER, 1, 1);
		assertTrue("StartRule improperly set", st.useDaylightTime());
		assertTrue("StartRule improperly set", st
				.inDaylightTime((new GregorianCalendar(1998, Calendar.NOVEMBER,
		assertTrue("StartRule improperly set", !(st
				.inDaylightTime(new GregorianCalendar(1998, Calendar.OCTOBER,
Contextual code suggestions in your IDE  Get Codota for Java