Get the observed Daylight Time from SimpleTimeZone in Java
Description
The following code shows how to get the observed Daylight Time from SimpleTimeZone.
Example
//from www . j a v a2 s . c om
import java.util.Calendar;
import java.util.SimpleTimeZone;
public class Main {
public static void main(String[] args) {
SimpleTimeZone simpleTimeZone = new SimpleTimeZone(-21600000, "CST",
Calendar.MARCH, 1, -Calendar.SUNDAY, 7200000, Calendar.NOVEMBER, -1,
Calendar.SUNDAY, 7200000, 3600000);
System.out.println(simpleTimeZone.getDisplayName() + " - "
+ simpleTimeZone.observesDaylightTime());
}
}
The code above generates the following result.