TimeZone.inDaylightTime(Date date) has the following syntax.
public abstract boolean inDaylightTime(Date date)
In the following code shows how to use TimeZone.inDaylightTime(Date date) method.
import java.util.Date; import java.util.TimeZone; //from w w w . j av a 2 s . com public class Main { public static void main( String args[] ){ TimeZone timezoneone = TimeZone.getDefault(); // create date object Date date = new Date(); // checking day light System.out.println("In daylight time:" +timezoneone.inDaylightTime(date)); } }
The code above generates the following result.