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 ParametersDescriptionReturn TypeUsage Examples
DaysThe days component of the timespanInteger$Utils.GetTimeSpan("2.16:32:05.555").Days$2
Format(string format)Formats a timespan value using standard or custom .Net formatting stringsString$Utils.GetTimeSpan("2.16:32:05.555").Format(hh\:mm\:ss)$"16:32:05"
FullAbbreviatedTextA full string representation of the timespan using abbreviated unit namesString$Utils.GetTimeSpan("2.16:32:05.555").FullAbbreviatedText$"64h 32m 5s 555ms"
HoursThe hours component of the timespanInteger$Utils.GetTimeSpan("2.16:32:05.555").Hours$16
LongTextA long string representation of the timespan String$Utils.GetTimeSpan("2.16:32:05.555").LongText$"2 days, 16 hours"
MillisecondsThe milliseconds component of the timespanInteger$Utils.GetTimeSpan("2.16:32:05.555").Milliseconds$555
MinutesThe minutes component of the timespanInteger$Utils.GetTimeSpan("2.16:32:05.555").Minutes$32
SecondsThe seconds component of the timespanInteger$Utils.GetTimeSpan("2.16:32:05.555").Seconds$5
ShortAbbreviatedTextA short string representation of the timespan using abbreviated unit namesString$Utils.GetTimeSpan("2.16:32:05.555").ShortAbbreviatedText$"64h 32m"
ShortTextA short string representation of the timespan with components separated with colonsString$Utils.GetTimeSpan("2.16:32:05.555").ShortText$"64:32:5.555"
ShortTextPaddedA short string representation of the timespan with components separated with colons padded with zerosString$Utils.GetTimeSpan("2.16:32:05.555").ShortTextPadded$"64:32:05.555"
TextA long string representation of the timespanString$Utils.GetTimeSpan("2.16:32:05.555").Text$"2 days, 16 hours"
TotalDaysThe total value of the timespan expressed as whole and fractional daysNumber$Utils.GetTimeSpan("2.16:32:05.555").TotalDays$2.68895318287037
TotalHoursThe total value of the timespan expressed as whole and fractional hoursNumber$Utils.GetTimeSpan("2.16:32:05.555").TotalHours$64.5348763888889
TotalMillisecondsThe total value of the timespan expressed as whole and fractional millisecondsNumber$Utils.GetTimeSpan("2.16:32:05.555").TotalMilliseconds$232325555
TotalMinutesThe total value of the timespan expressed as whole and fractional minutesNumber$Utils.GetTimeSpan("2.16:32:05.555").TotalMinutes$3872.09258333333
TotalSecondsThe total value of the timespan expressed as whole and fractional secondsNumber$Utils.GetTimeSpan("2.16:32:05.555").TotalSeconds$232325.555



  • No labels