Skip to main content

inRange

Check whether a time falls between two other times (inclusive).


Examples

Check if the current time is in a maintenance window:

now.inRange(
parse.date("2006-01-02 15:04", "2025-05-01 00:00"),
parse.date("2006-01-02 15:04", "2025-05-01 06:00")
)

Check if a certificate expiry date is within the next 30 days:

cert.notAfter.inRange(now, now + parse.duration("720h"))