pub fn duration(value: Arc<String>) -> Result<Value, ExecutionError>
Expand description
Duration parses the provided argument into a Value::Duration
value.
The argument must be string, and must be in the format of a duration. See
the [parse_duration
] documentation for more information on the supported
formats.
ยงExamples
1h
parses as 1 hour1.5h
parses as 1 hour and 30 minutes1h30m
parses as 1 hour and 30 minutes1h30m1s
parses as 1 hour, 30 minutes, and 1 second1ms
parses as 1 millisecond1.5ms
parses as 1 millisecond and 500 microseconds1ns
parses as 1 nanosecond1.5ns
parses as 1 nanosecond (sub-nanosecond durations not supported)