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

Compare with Current View Page History

« Previous Version 2 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$Server.Now.Format("hh:mm")$"23:55" (given the date time "31/12/2000 23:55:333")
FullAbreviatedTextA full string representation of the timespan using abbreviated unit namesString

HoursThe hours component of the timespanInteger

LongTextA long string representation of the timespan String

MillisecondsThe milliseconds component of the timespanInteger

MinutesThe minutes component of the timespanInteger

SecondsThe seconds component of the timespanInteger

ShortAbbreviatedTextA short string representation of the timespan using abbreviated unit namesString

ShortTextA short string representation of the timespan with components separated with colonsString

ShortTextPaddingA short string representation of the timespan with components separated with colons padded with zerosString

TextA long string representation of the timespanString

TotalHoursThe total value of the timespan expressed as whole and fractional hoursNumber

TotalMillisecondsThe total value of the timespan expressed as whole and fractional millisecondsNumber

TotalMinutesThe total value of the timespan expressed as whole and fractional minutesNumber

TotalSecondsThe total value of the timespan expressed as whole and fractional secondsNumber






  • No labels