Here you can find the source of isInDayLight()
public static boolean isInDayLight()
//package com.java2s; import java.util.Calendar; import java.util.Date; import java.util.TimeZone; public class Main { public static boolean isInDayLight() { Date date = Calendar.getInstance().getTime(); TimeZone tz = TimeZone.getDefault(); return tz.inDaylightTime(date); }/*from w w w .j a v a 2 s . c o m*/ }