Overnight time based rules

Hello,
I am new to Sharptools and need some help with overnight time based rules. How do I set up an IF condition to run only between 10:00pm (day 1) and 8:00am the next day (day 2)? It seems that the rule evaluates the current time of day 2 after midnight, which does not fall between that time range, so the rule does not run.

Any help is very appreciated.

Update: I did find the OR operator in the IF action, so I am going to try IF time is after 10:00p OR before 8:00am. If there is an easier way to do this, please let me know.

Did you use the Time is between option in the IF section? I use this often and it works well for times that span midnight.

Can you post your rule?


Terri,
Thanks for the reply. Here is my current rule. I started with the Time Is Between condition, but the rule did not run. After some youtube tutorials, it seems that if something is triggered after midnight on day 2, the Time Is Between condition is looking at the current date of day 2, so the timeframe from 10p-8a does not apply. But that is just a guess. Did I miss something with the Time Is Between condition?

I changed my rule to look at any time after 10pm with the OR operator and any time before sunrise, so hopefully that should be true regardless of the date and the rule will work.

I haven’t noticed this behavior but maybe I just haven’t paid close enough attention. :smile:
tagging @josh to get his input.

The way you have your rule written should work fine.

Either one should work fine. “Time is between 10:00 PM and 8:00 AM” should be equivalent to “Time is after 10:00 PM -OR- Time is before 8:00 AM”

Jeff’s rule shows one place where the OR is better though and that’s where you want to be between some time and sunset/sunrise as ‘between’ doesn’t current support that. :slight_smile:

1 Like