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:
Suffix | Units | Minimum Value | Maximum Value |
---|---|---|---|
ms | millisecond | -9223372036854 | 9223372036854 |
s | second | -9223372036 | 9223372036 |
m | minute | -153722867 | 153722867 |
h | hour | -2562047 | 2562047 |
d | day | -106751 | 106751 |
y | year | -292 | 292 |
User contributed notes
BETADo you see an error in this page? Do have an interesting use case, example or edge case people should know about? Share your knowledge and help people who are reading this page! (Comments are moderated; for support, please contact support@fastly.com)