LOG IN SIGN UP
Documentation

RTIME

A relative time, rendered in decimal format. Units may be in milliseconds, seconds, minutes, hours, or days. These are specified by a suffix of ms, s, m, h, d, and y respectively. Whitespace is permitted between the value and its unit. Negative durations are permitted. For example:

declare local var.r RTIME;
set var.r = 0ms;
set var.r = 5.3d;
set var.r = -2s;
set beresp.ttl = 5 m;

Conversions to STRING values are rendered with no units, with values given in seconds to 3dp precision:

declare local var.r RTIME;
set var.r = 3.5d;
set resp.http.X-r = var.r; /* "302400.000" */

RTIME values resolve into 64-bit signed integers measured in nanoseconds. An RTIME value specified in VCL that - when converted into nanoseconds - is less than -9223372036854775808(ns) or greater than 9223372036854775807(ns), will be clamped to these respective minimum or maximum values:

Units Mininum Value Maximum Value
millisecond (ms) -9223372036854 9223372036854
second (s) -9223372036 9223372036
minute (m) -153722867 153722867
hour (h) -2562047 2562047
day (d) -106751 106751
year (y) -292 292

Back to Top