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.

1 Like

I have just started using this expression for day/night

as opposed to slightly more complicated one I have been using, but it seems that once the day cycles through it does not go back to “DAYTIME” visible the next day. It is doing this for both creator and in the preview page, I have have not put this face on my watch yet.
Is this a creator issue or did I do something or miss something?

Here is watch preview and inspection:

That is the way Facer has the backbone of the Facer Creator and the Preview page written. It will ONLY work on today’s date. If you have it set for yesterday or tomorrow the day/night conditional will not function. In creator just set the “Time Machine” to 8:00 and switch between AM and PM and that will test the function of the $#DISDAYTIME#==true?100:0$ and $#DISDAYTIME#==false?100:0$ conditionals.

2 Likes

Thanks mrantisocialguy,
I thought this might be the case but thought id clarify!

I used

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

night$(#DH#+1)>=(#WSH#)&&(#DH#+1)<=(#WSH#)?((#Dm#)(100)):$$(#DH#+1)<=(#WRH#)&&(#DH#+1)>=(#WRH#)?(100-(#Dm#(100))):$$(#DH#+1)<(#WSH#)&&(#DH#+1)>(#WRH#)?0:100$

1 Like

Welcome and good work.