timeRange()
True if the current time is within the given hour/minute/second range.
timeRange(hour | hour, min | hour, min, sec ... [, "GMT"]) → booleanLocal time unless “GMT” is passed. The checker evaluates time functions at a fixed “now” you can set, so results are reproducible.
Example
if (timeRange(8, 18)) {
return "PROXY proxy.corp.example:8080";
}
Engine notes
| Engine | Behaviour | Source |
|---|---|---|
| chromium | Supports wrap-around ranges such as 22 to 6. | code, verified 2026-10-04 |
| pacparser | No wrap-around ranges. | code, verified 2026-10-04 |
Availability
| Function | chromium | chromium | firefox | pacparser | pacparser | pacparser | reference |
|---|---|---|---|---|---|---|---|
timeRange | yes | yes | yes | yes | yes | yes | yes |