java.util.TimeZone.useDaylightTime() Method

Advertisements


Description

The useDaylightTime() method is used to query if this time zone uses daylight savings time.

Declaration

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

public abstract boolean useDaylightTime()

Parameters

  • NA

Return Value

The method call returns true if this time zone uses daylight savings time, false, otherwise.

Exception

  • NA

Example

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

package com.tutorialspoint;

import java.util.*;

public class TimeZoneDemo {
   public static void main( String args[] ){
       
      // create time zone object 
      TimeZone tzone = TimeZone.getDefault();      

      // checking daylight time
      System.out.println("Using day light time :" +tzone.useDaylightTime());
   }    
}

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

Using day light time :false



Advertisements
Advertisements