Home / Search/ Language Reference/ Types/timespan

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:

ValueLength of time
2d2 days
1.5h1.5 hour
30m30 minutes
10s10 seconds
0.1s0.1 second
100ms100 millisecond
10microsecond10 microseconds
1tick100ns
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)