Java SimpleTimeZone.setEndRule(int endMonth, int endDay, int endDayOfWeek, int endTime)
Syntax
SimpleTimeZone.setEndRule(int endMonth, int endDay, int endDayOfWeek, int endTime) has the following syntax.
public void setEndRule(int endMonth, int endDay, int endDayOfWeek, int endTime)
Example
In the following code shows how to use SimpleTimeZone.setEndRule(int endMonth, int endDay, int endDayOfWeek, int endTime) method.
/* w w w .ja va2 s . c o m*/
import java.util.Calendar;
import java.util.SimpleTimeZone;
public class Main {
public static void main( String args[] ){
SimpleTimeZone stobj = new SimpleTimeZone(-28800000,
"America/Los_Angeles", Calendar.AUGUST, 1,-Calendar.SUNDAY, 7200000,
Calendar.DECEMBER, -1, Calendar.SUNDAY, 7200000, 3600000);
// checking the initial value
System.out.println("Initial value : " + stobj);
// setting end rule
stobj.setEndRule( Calendar.MAY, 2, Calendar.TUESDAY, 3600000);
// checking the new value
System.out.println("New value : " + stobj);
}
}
The code above generates the following result.
Home »
Java Tutorial »
java.util »
Java Tutorial »
java.util »