java.util.SimpleTimeZone.useDaylightTime() Method


Advertisements


Description

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

Declaration

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

public boolean useDaylightTime()

Parameters

NA

Return Value

The method call returns 'true' if this time zone uses daylight saving time; false otherwise.

Exception

NA

Example

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

Live Demo
package com.tutorialspoint;

import java.util.*;

public class SimpleTimeZoneDemo {
   public static void main( String args[] ) {
      
      // create simple time zone object
      SimpleTimeZone stobj = new SimpleTimeZone(820,"US");

      // checking day light time  
      System.out.println("Use day light time : " + stobj.useDaylightTime());
   }      
}

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

Use day light time : false

java_util_simpletimezone.htm

Advertisements