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:
import java.util.SimpleTimeZone;
public class GFG {
public static void main(String[] args)
{
SimpleTimeZone obj
= new SimpleTimeZone( 580 , "India" );
System.out.println( "DST saving = "
+ obj.getDSTSavings());
}
}
|
Program 2:
import java.util.SimpleTimeZone;
public class GFG {
public static void main(String[] args)
{
SimpleTimeZone obj
= new SimpleTimeZone( 580 , "US" );
System.out.println( "DST saving = "
+ obj.getDSTSavings());
}
}
|
Last Updated :
02 Jan, 2019
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...