Java Date Time - Java SimpleTimeZone .setRawOffset (int offsetMillis)








Syntax

SimpleTimeZone.setRawOffset(int offsetMillis) has the following syntax.

public void setRawOffset(int offsetMillis)

Example

In the following code shows how to use SimpleTimeZone.setRawOffset(int offsetMillis) method.

//from w w w  . j  a  v a 2s.  c o  m
import java.util.SimpleTimeZone;

public class Main {
   public static void main( String args[] ){
      
      SimpleTimeZone stobj = new SimpleTimeZone(820,"GMT");
       
      // checking initial value     
      System.out.println("Initial raw offset: " + stobj.getRawOffset());
      
      // setting raw offset   
      stobj.setRawOffset(7200000);      
      
      // checking the new value      
      System.out.println("Final raw offset value : " + stobj.getRawOffset());
   }      
}

The code above generates the following result.