Function cel_interpreter::functions::duration
source · 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
1hparses as 1 hour1.5hparses as 1 hour and 30 minutes1h30mparses as 1 hour and 30 minutes1h30m1sparses as 1 hour, 30 minutes, and 1 second1msparses as 1 millisecond1.5msparses as 1 millisecond and 500 microseconds1nsparses as 1 nanosecond1.5nsparses as 1 nanosecond (sub-nanosecond durations not supported)