timebetween

Description

The timebetween() function determines whether the current time, as defined on the Policy Server host, is between time1 and time2, inclusive.

The time1 and time2 parameters contain integer time values. These time values should be specified in military time (HHMM) format, where:

HH A number from 0 to 23, inclusive, that represents the hour
MM A number between 0 to 59, inclusive, that represents the minutes

If time2 < time1, the comparison crosses the midnight boundary.

Syntax

result = timebetween (time1, time2);

Arguments

time1 Required. An integer containing a time value formatted as HHMM
time2 Required. An integer containing a time value formatted as HHMM

Return Values

true The current time is between time1 and time2 or the current time is equal to either time1 or time2.
false The current time is either less time1 or greater than time2.

Example

In the example,

result = timebetween (1100, 1500);

the following times set result as follows:

  • 08:00 result set to false
  • 11:00 result set to true
  • 12:30 result set to true
  • 15:00 result set to true
  • 15:01 result set to false