(defun sunlightp ()
(let* ((sr/sn (solar-sunrise-sunset (calendar-current-date)))
(sunrise (caar sr/sn))
(sunset (caadr sr/sn))
(time (decode-time (current-time)))
(fractional-hour (+ (float (caddr time))
(/ (float (cadr time)) 60.0))))
(< sunrise fractional-hour sunset)))
Requires calendar-longitude and calendar-latitude to be set. I was surprised at not being able to find something like this with a quick online search so enjoy.