Chapter 3: Condition Reference
77
hour=
Tests if the time of day is in the specified range or an exact match. The current time is determined by
the ProxySG appliance’s configured clock and time zone by default, although the UTC time zone can
be specified by using the form hour.utc=. The numeric pattern used to test the hour= condition
contains no whitespace.
Note: Any range of hours or exact hour includes all the minutes in the final hour. See the
“Examples” section.
Syntax
hour[.utc]={first_hour]..[last_hour]|exact_hour}
where:
first_hour—Two digits (nn) in 24-hour time format representing the first hour in a range; for
example, 09 means 9:00 a.m. If left blank, midnight (00) is assumed—exactly 00:00 a.m.
last_hour—Two digits (nn) in 24-hour time format representing the last full hour in a range; for
example, 17 specifies 5:59 p.m. If left blank, 23 is assumed (23:59 p.m.).
exact_time—Two digits (nn) in 24-hour time format representing an exact, full hour.
Note: To test against an inverted range, such as a range that crosses from one day into the next, the
following shorthand expression is available. While hour=(..06|19..) specifies midnight to
6:59 a.m. and 7:00 p.m. to midnight, the policy language also recognizes hour=19..06 as
equivalent.
Layer and Transaction Notes
Use in all layers.
Using time-related conditions to control caching behavior in a <Cache> layer may cause thrashing
of the cached objects.
Applies to all transactions.
Examples
; Tests for 3:00 a.m. to 1:59 p.m. UTC.
hour.utc=03..13
; The following example restricts access to external sites during business hours.
; This rule assumes that the user has access that must be restricted.
<proxy>
; Internal site always available, no action required
server_url.domain=xyz.com
; Restrict other sites during business hours
deny weekday=1..5 hour=9..16
; If a previous rule had denied access, then this rule could provide an exception.