TimeSpan Object

The timespan object represents a period of time or duration, and includes properties and functions to extract numbers, and functions to convert to a string representation. Note that the formatting output is based on the regional settings of the server or agent where the expression is evaluated.

Name and Parameters Description Return Type Usage Examples
Days The days component of the timespan Integer $Utils.GetTimeSpan("2.16:32:05.555").Days$ 2
Format(string format) Formats a timespan value using standard or custom.Net formatting strings String $Utils.GetTimeSpan("2.16:32:05.555").Format(hh:mm:ss)$ "16:32:05"
FullAbbreviatedText A full string representation of the timespan using abbreviated unit names String $Utils.GetTimeSpan("2.16:32:05.555").FullAbbreviatedText$ "64h 32m 5s 555ms"
Hours The hours component of the timespan Integer $Utils.GetTimeSpan("2.16:32:05.555").Hours$ 16
LongText A long string representation of the timespan String $Utils.GetTimeSpan("2.16:32:05.555").LongText$ "2 days, 16 hours"
Milliseconds The milliseconds component of the timespan Integer $Utils.GetTimeSpan("2.16:32:05.555").Milliseconds$ 555
Minutes The minutes component of the timespan Integer $Utils.GetTimeSpan("2.16:32:05.555").Minutes$ 32
Seconds The seconds component of the timespan Integer $Utils.GetTimeSpan("2.16:32:05.555").Seconds$ 5
ShortAbbreviatedText A short string representation of the timespan using abbreviated unit names String $Utils.GetTimeSpan("2.16:32:05.555").ShortAbbreviatedText$ "64h 32m"
ShortText A short string representation of the timespan with components separated with colons String $Utils.GetTimeSpan("2.16:32:05.555").ShortText$ "64:32:5.555"
ShortTextPadded A short string representation of the timespan with components separated with colons padded with zeros String $Utils.GetTimeSpan("2.16:32:05.555").ShortTextPadded$ "64:32:05.555"
Text A long string representation of the timespan String $Utils.GetTimeSpan("2.16:32:05.555").Text$ "2 days, 16 hours"
TotalDays The total value of the timespan expressed as whole and fractional days Number $Utils.GetTimeSpan("2.16:32:05.555").TotalDays$ 2.68895318287037
TotalHours The total value of the timespan expressed as whole and fractional hours Number $Utils.GetTimeSpan("2.16:32:05.555").TotalHours$ 64.5348763888889
TotalMilliseconds The total value of the timespan expressed as whole and fractional milliseconds Number $Utils.GetTimeSpan("2.16:32:05.555").TotalMilliseconds$ 232325555
TotalMinutes The total value of the timespan expressed as whole and fractional minutes Number $Utils.GetTimeSpan("2.16:32:05.555").TotalMinutes$ 3872.09258333333
TotalSeconds The total value of the timespan expressed as whole and fractional seconds Number $Utils.GetTimeSpan("2.16:32:05.555").TotalSeconds$ 232325.555