Time of the day

Hi there!

How can we identify the time of the day? (morning, afternoon and night)
I made this expression but is mistaken the time of the day…

CONCATENATE("¡Hola ",[Nombre], " “,
IFS(TIMENOW()>=“00:00:00”,” good night! “,
TIMENOW()>=“07:00:00”,” good morning! “,
TIMENOW()>=“12:01:00”,” good afternoon! ",
true,
“no aplica”
)
)
Thanks!

Hi,

There is a way to do this with the hour function. I got something similar working with:

IFS(
 HOUR(TIMENOW() - "00:00:00") > 12, "Good afternoon!",
 HOUR(TIMENOW() - "00:00:00") > 7, "Good morning!",
 HOUR(TIMENOW() - "00:00:00") > 0, "Good night!")

You have to subtract “00:00:00” from TIMENOW() because the function is meant to operate on intervals rather than absolute times.

3 Likes