SimpleTimeZone getRawOffset() method in Java with Examples
Last Updated :
02 Jan, 2019
The getRawOffset() method of SimpleTimeZone class is used to get the GMT offset for this time zone.
Syntax:
public int getRawOffset()
Parameters: The function does not accepts any parameters.
Return Value: It returns the GMT offset value in milliseconds.
Exception: The function does not throws any exceptions.
Program below demonstrates the above mentioned function:
Program 1:
import java.util.*;
public class GFG {
public static void main(String[] args)
{
SimpleTimeZone obj
= new SimpleTimeZone( 580 , "INDIA" );
System.out.println( "Raw Offset is = "
+ obj.getRawOffset());
}
}
|
Output:
Raw Offset is = 580
Program 2:
import java.util.*;
public class GFG {
public static void main(String[] args)
{
SimpleTimeZone obj
= new SimpleTimeZone( 640 , "INDIA" );
System.out.println( "Raw Offset is = "
+ obj.getRawOffset());
}
}
|
Output:
Raw Offset is = 640
Share your thoughts in the comments
Please Login to comment...