SimpleTimeZone.getOffset(long date) has the following syntax.
public int getOffset(long date)
In the following code shows how to use SimpleTimeZone.getOffset(long date) method.
// w w w .j a v a2 s . co m import java.util.Calendar; import java.util.SimpleTimeZone; public class Main { public static void main( String args[] ){ SimpleTimeZone stobj = new SimpleTimeZone(720,"US"); // get offset int offset=stobj.getOffset(Calendar.ZONE_OFFSET); // check offset value System.out.println("Offset is : " + offset); } }
The code above generates the following result.