Skip to main content
Version: v4.25

duration

Casts an expression to a duration value.

duration(x:string) -> duration

Description

The duration function casts the given string x to a duration value.

Examples

Cast a string to a duration

from {str: "1ms"}
dur = duration(str)
{str: "1ms", dur: 1ms}

See Also

time