Java Date Time - Java SimpleTimeZone .inDaylightTime (Date date)








Syntax

SimpleTimeZone.inDaylightTime(Date date) has the following syntax.

public boolean inDaylightTime(Date date)

Example

In the following code shows how to use SimpleTimeZone.inDaylightTime(Date date) method.

/*from  w  ww . j ava  2  s . c o  m*/

import java.util.Date;
import java.util.SimpleTimeZone;

public class Main {
   public static void main( String args[] ){
           
      SimpleTimeZone stobj1 = new SimpleTimeZone(820,"GMT");
      
      // create date
      Date date = new Date();
      
      // check day light
      boolean daylight=stobj1.inDaylightTime(date); 
      
      // checking the value of day light      
      System.out.println("Is in day light : " + daylight);
   }     
}

The code above generates the following result.