SimpleTimeZone setDSTSavings() method in Java with Examples
Last Updated :
08 Aug, 2022
The setDSTSavings() method of SimpleTimeZone class is used to set the amount of time that the clock is advanced during daylight saving time. The calculation is done in milliseconds.
Syntax:
public void setDSTSavings(int millisSavedDuringDST)
Parameters: The function accepts a single parameter millisSavedDuringDST which specifies the number of milliseconds the time is advanced with respect to standard time.
Return Value: The method has no return value.
Exception: The function does not throws any exception.
Program below demonstrates the above mentioned function:
Program 1:
Output:
Initially DST saving value is = 3500000
DST saving value set to 6000000
Current DST saving value is = 6000000
Program 2:
Output:
Initially DST saving value is = 3500000
DST saving value set to 4000000
Current DST saving value is = 4000000
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...