How to distinguish these two time periods ?

I want to judge two time periods,
9:30 - 18:00 is work time, otherwise it is relax time.

I use the %ICUDateTime%HH% ,but the result can not compare with Integer number.
How to distinguish these two time periods ? Thanks very much

Store %ICUDateTime%H% and %ICUDateTime%m% in variables and then do calculations and comparisons with those variables. Keyboard Maestro will convert them to numbers as needed. Like this:

Image of Time Test macro

3 Likes

With your help, I have solved it , thanks very much

Easier is to use the HOUR and MINUTE function, like this:

100*HOUR()+MINUTE() >= 930 AND HOUR() < 18

image

Note the cheat of using 100 instead of 60 in the multiplication to make the numbers easier to read.

5 Likes