Is it day or night?

I would like to set opacity to 100 during day, to 0 during night.
I wanted to use the sunset and sunrise times, but I would have to do some embedded conditionals like:

$(#Dk#>#WRH#||(#Dk#==#WRH#&&#Dm#>=#WRm#)) – that is: after sunrise
&&
(#Dk#<#WSH#||(#Dk#==#WSH#&&#Dm#<=#WSm#)) – that is: before sunset
?100:0$

which is of course forbidden.
How can I do?

Thanks for any help!

I found the solution:
$(#DH#+(#Dm#/60))>=(#WRH#+(#WRm#/60))&&(#DH#+(#Dm#/60))<=(#WSH#+(#WSm#/60))?100:0$
will give 100 for daytime, 0 for night.

2 Likes

If you use this conditional in the Opacity box it will be 100% during the day and not show at night and works with the local sunrise/sunset times.

$#DISDAYTIME#==true?100:0$

This is what I use on all my watch faces. If you want it to show at night, just change “true” to “false” and it will only show at night.