Code example for TimeZone

Methods: getDSTSavings

0
                             ONE_HOUR, tz1.getDSTSavings());
 
		// an instance without daylight savings 
		tz1 = new Support_TimeZone(3 * ONE_HOUR, false);
		assertEquals("T3. Incorrect daylight savings returned, ",
                             0, tz1.getDSTSavings());
	} 
 
	/** 
	 * @tests java.util.TimeZone#getOffset(long) 
	 */ 
	public void test_getOffset_long() { 
		// Test for method int java.util.TimeZone.getOffset(long time) 
 
		// test on subclass SimpleTimeZone 
		TimeZone st1 = TimeZone.getTimeZone("EST");
		long time1 = new GregorianCalendar(1998, Calendar.NOVEMBER, 11)
				.getTimeInMillis();
		assertEquals("T1. Incorrect offset returned",
                             -(5 * ONE_HOUR), st1.getOffset(time1));
Experience pair programming with AI  Get Codota for Java