Java Date Time - Java SimpleTimeZone .setDSTSavings (int millisSavedDuringDST)








Syntax

SimpleTimeZone.setDSTSavings(int millisSavedDuringDST) has the following syntax.

public void setDSTSavings(int millisSavedDuringDST)

Example

In the following code shows how to use SimpleTimeZone.setDSTSavings(int millisSavedDuringDST) method.

//ww  w.  j  ava  2 s . c om
import java.util.Calendar;
import java.util.SimpleTimeZone;

public class Main {
   public static void main( String args[] ){
      
      SimpleTimeZone stobj = new SimpleTimeZone(-28800000, "India", 
      Calendar.MAY, 1,-Calendar.SUNDAY, 7200000, Calendar.OCTOBER, -1,
      Calendar.MONDAY, 7200000, 3600000);
      
      // setting DST saving time
      stobj.setDSTSavings(5400000); 
      
      // checking the value      
      System.out.println("DST saving value : " + stobj.getDSTSavings());
   }     
}

The code above generates the following result.