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:

filter_none

edit
close

play_arrow

link
brightness_4
code

// 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());
    }
}

chevron_right


Output:

DST saving = 0

Program 2:

filter_none

edit
close

play_arrow

link
brightness_4
code

// 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());
    }
}

chevron_right


Output:

DST saving = 0


My Personal Notes arrow_drop_up

Contented with little yet wishing for more

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.