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!

Solved Solved
0 1 289
1 ACCEPTED SOLUTION

Former Community Member
Not applicable

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.

View solution in original post

1 REPLY 1

Former Community Member
Not applicable

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.

Top Labels in this Space