timespan
The timespan
(time
) data type represents a time interval, in seconds.
This representation differs from the standard Kusto
timespan
type, which represents a literal timespan.
timespan
Literals
Literals of type timespan
have the syntax timespan(value)
, where a number of formats are supported for value
,
as indicated by the following table:
Value | Length of time |
---|---|
2d | 2 days |
1.5h | 1.5 hour |
30m | 30 minutes |
10s | 10 seconds |
0.1s | 0.1 second |
100ms | 100 millisecond |
10microsecond | 10 microseconds |
1tick | 100ns |
time(15 seconds) | 15 seconds |
time(2) | 2 days |
time(0.12:34:56.7) | 0d+12h+34m+56.7s |
The special form time(null)
is the null value.
timespan
Operators
Two values of type timespan
may be added, subtracted, and divided. The last operation returns a value of type real
representing the fractional number of times one value can fit the other.
Examples
The following examples calculate, in several ways, how many seconds are in a day:
1d / 1s
time(1d) / time(1s)
24 * 60 * time(00:01:00) / time(1s)