1 | Target time-of-day is within the given interval. |
0 | Target time-of-day is outside the given interval. |
TargetTimeOfDay | Time-of-day to check. |
IntervalMidpoint | Midpoint of the interval to check against (see Examples for details). |
IntervalWidth | Width of the interval to check against (see Examples for details). |
Option | Whether to count a target time-of-day that falls on an endpoint as being within the interval. Defaults to BothInclusive (see More Info). |
Note that the default for this command differs from CurrentTimeOfDayIsAbout
. For this command the default is BothInclusive
. This means that if you give an interval of 11:55 to 12:05 and the target is 11:55 then it will consider it as falling within the interval. CurrentTimeOfDayIsAbout
will be changed in the next major release.
The time-of-day should be formatted according to the configuration (see here for details or SetTimeOfDayFormat
). The configuration defaults to %H:%M:%S, which means 12 o'clock is 12:00:00. (And if you are happy with that, you do not have to do anything to make it work, only if you want something different.)
The interval format is {xH yM zS} where x, y, and z are all integers and stand for hours, minutes, and seconds. See examples for usage.
Options are:
1. BothExclusive (Second < First < Third).
2. BothInclusive (Second <= First <= Third).
3. LeftExclusive (Second < First <= Third).
4. LeftInclusive (Second <= First < Third).
5. RightExclusive (Second <= First < Third).
6. RightInclusive (Second < First <= Third).
Left and right are referring to the interval going around the target time, not the current time. So if the target time is 06:00:00 and the interval is an hour, then LeftInclusive
includes 05:00:00, and RightInclusive
includes 07:00:00. See examples to understand the options.
% TimeOfDayIsAbout 11:59:00 12:00:00 "0H 5M 0S"
1
% TimeOfDayIsAbout 11:55:00 12:00:00 "0H 5M 0S" BothInclusive
1
% TimeOfDayIsAbout 11:55:00 12:00:00 "0H 5M 0S" BothExclusive
0