You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

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





  • No labels