SimpleTimeZone getRawOffset() method in Java with Examples
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:
// program to demonstrate the // function java.util.SimpleTimeZone.getRawOffset() import java.util.*; public class GFG { public static void main(String[] args) { // create simple time zone object SimpleTimeZone obj = new SimpleTimeZone(580, "INDIA"); // get raw offset value and print System.out.println("Raw Offset is = " + obj.getRawOffset()); } } |
chevron_right
filter_none
Output:
Raw Offset is = 580
Program 2:
// program to demonstrate the // function java.util.SimpleTimeZone.getRawOffset() import java.util.*; public class GFG { public static void main(String[] args) { // create simple time zone object SimpleTimeZone obj = new SimpleTimeZone(640, "INDIA"); // get raw offset value and print System.out.println("Raw Offset is = " + obj.getRawOffset()); } } |
chevron_right
filter_none
Output:
Raw Offset is = 640
Recommended Posts:
- TimeZone getRawOffset() Method in Java with Examples
- SimpleTimeZone hasSameRules() method in Java with Examples
- SimpleTimeZone equals() method in Java with Examples
- SimpleTimeZone toString() method in Java with Examples
- SimpleTimeZone setDSTSavings() method in Java with Examples
- SimpleTimeZone setRawOffset() method in Java with Examples
- SimpleTimeZone getOffset() method in Java with Examples
- SimpleTimeZone setStartRule(int, int, int) method in Java with Examples
- SimpleTimeZone inDaylightTime() method in Java with Examples
- SimpleTimeZone hashCode() method in Java with Examples
- SimpleTimeZone clone() method in Java with Examples
- SimpleTimeZone getDSTSavings() method in Java with Examples
- SimpleTimeZone setEndRule(int, int, int) method in Java with Examples
- SimpleTimeZone useDaylightTime() method in Java
- SimpleTimeZone setStartYear() method in Java
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



