parse_time_delta()

Parses a string representing a time delta and returns an integer number of seconds. This function supports the specifiers "d" and "D" for days, "h" and "H" for hours, "m" and "M" for minutes, and "s" and "S" for seconds. The function parses individual deltas like "15m" and "7d". Strings like "10d11h3m2s" are not supported. In case of invalid input, the function returns -1.

Format

INTEGER
parse_time_delta(STRING specifier)

Examples

1
set beresp.ttl = parse_time_delta(beresp.http.Edge-Control:cache-maxage);