Redigera

Dela via


totimespan()

Applies to: ✅ Microsoft FabricAzure Data ExplorerAzure MonitorMicrosoft Sentinel

Converts the input to a timespan scalar value.

Deprecated aliases: totime()

Note

When possible, we recommend using timespan literals instead.

Syntax

totimespan(value)

Learn more about syntax conventions.

Parameters

Name Type Required Description
value string ✔️ The value to convert to a timespan.

Returns

If conversion is successful, result is a timespan value. Else, result is null.

Example

The following example checks whether the input matches the defined timespan.

totimespan("0.00:01:00") == time(1min)