SimpleTimeZone getDSTSavings() method in Java with Examples
The getDSTSavings() method of SimpleTimeZone class returns the amount of time (in milliseconds) that the clock advances during daylight saving time.
Syntax:
public int getDSTSavings()
Parameters: The function does not accepts any parameter.
Return Value: The method returns the time is advanced with respect to standard time(in milliseconds).
Exception: The function does not throws any exception.
Program below demonstrates the above mentioned function:
Program 1:
// program to demonstrate the // function java.util.date.getDSTSavings() import java.util.SimpleTimeZone; public class GFG { public static void main(String[] args) { // creating simple time zone object SimpleTimeZone obj = new SimpleTimeZone(580, "India"); // check DST saving and print System.out.println("DST saving = " + obj.getDSTSavings()); } } |
DST saving = 0
Program 2:
// program to demonstrate the // function java.util.date.getDSTSavings() import java.util.SimpleTimeZone; public class GFG { public static void main(String[] args) { // creating simple time zone object SimpleTimeZone obj = new SimpleTimeZone(580, "US"); // check DST saving and print System.out.println("DST saving = " + obj.getDSTSavings()); } } |
DST saving = 0
Recommended Posts:
- TimeZone getDSTSavings() Method in Java with Examples
- SimpleTimeZone setRawOffset() method in Java with Examples
- SimpleTimeZone getOffset() method in Java with Examples
- SimpleTimeZone hasSameRules() method in Java with Examples
- SimpleTimeZone setStartRule(int, int, int) method in Java with Examples
- SimpleTimeZone inDaylightTime() method in Java with Examples
- SimpleTimeZone equals() method in Java with Examples
- SimpleTimeZone toString() method in Java with Examples
- SimpleTimeZone hashCode() method in Java with Examples
- SimpleTimeZone clone() method in Java with Examples
- SimpleTimeZone getRawOffset() method in Java with Examples
- SimpleTimeZone setDSTSavings() method in Java with Examples
- SimpleTimeZone setEndRule(int, int, int) method in Java with Examples
- SimpleTimeZone setStartYear() method in Java
- SimpleTimeZone useDaylightTime() 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.



