SimpleTimeZone getDSTSavings() in Java

getDSTSavings(): This method is available in java.util.SimpleTimeZone class of Java.

Syntax:

int java.util.SimpleTimeZone.getDSTSavings()

This method returns the amount of time in milliseconds that the clock is advanced during daylight saving time.

Parameters: NA

Returns: the number of milliseconds the time is advanced with respect to standard time when the daylight saving rules are in effect, or 0 (zero) if this time zone doesn't observe daylight saving time.

Exceptions: NA

Approach

Java

import java.util.SimpleTimeZone;

public class SimpleTimeZonegetDSTSavings {
    public static void main(String[] args) {

        SimpleTimeZone simpleTimeZone =
new SimpleTimeZone(100, "India");

        System.out.println(simpleTimeZone.getDSTSavings());
    }
}

Output:

0


No comments:

Post a Comment