java.util.TimeZone.getDSTSavings() Method



Description

The getDSTSavings() method is used to return the amount of time to be added to local standard time to get local wall clock time.

Declaration

Following is the declaration for java.util.TimeZone.getDSTSavings() method.

public int getDSTSavings()

Parameters

NA

Return Value

The method call returns the amount of saving time in milliseconds.

Exception

NA

Example

The following example shows the usage of java.util.TimeZone.getDSTSavings()

package com.tutorialspoint;

import java.util.*;

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

      // create time zone object     
      TimeZone timezone = TimeZone.getTimeZone("Europe/Paris");

      // checking DST saving         
      System.out.println("DST saving is :" + timezone.getDSTSavings());
   }    
}

Let us compile and run the above program, this will produce the following result.

DST saving is :3600000
java_util_timezone.htm
Advertisements