Skip to main content

TimeSpan functions

TimeSpan (or duration) functions work with time intervals. The internal representation of time intervals is the amount of time in milliseconds. For example, an interval of 1 hour would be stored as the number 3600000 (the number of milliseconds in one hour). Time spans include days, hours, minutes, seconds and milliseconds.

Function List:

InDays(ts)

Returns the number of full days in time span ts.

InDays(${Duration})

InHours(ts)

Returns the number of full hours days in time span ts.

InHours(${Duration})

InMinutes(ts)

Returns the number of full minutes days in time span ts.

InMinutes(${Duration})

InSeconds(ts)

Returns the number of full seconds days in time span ts.

InSeconds(${Duration})

InMilliseconds(ts)

Returns the number of milliseconds days in time span ts.

InMilliseconds(${Duration})

TimeSpan(days, hours, minutes, seconds, milliseconds)

Creates a TimeSpan from specified parameters.

TimeSpan(0, 1, 30, 0, 0)    // Time interval of 1.5 hours

TimeSpanParse(s)

Constructs and returns a TimeSpan based on string pattern s.

TimeSpanParse("01:00")    //  Creates a time interval of one hour

TotalDays(ts)

Returns the number of full and fractional parts of days in the TimeSpan ts.

TotalDays(TimeSpan(1, 12, 0, 0, 0))    // Time interval of 1.5 days

TotalHours(ts)

Returns the number of full and fractional parts of hours in the TimeSpan ts.

TotalHours(TimeSpan(0, 1, 30, 0, 0))    // Time interval of 1.5 hours

TotalMinutes(ts)

Returns the number of full and fractional parts of minutes in the TimeSpan ts.

TotalMinutes(TimeSpan(0, 0, 2, 30, 0))    // Time interval of 2.5 minutes

TotalSeconds(ts)

Returns the number of full and fractional parts of seconds in the TimeSpan ts.

TotalSeconds(TimeSpan(0, 0, 0, 7, 500))    // Time interval of 7.5 seconds

TotalMilliseconds(ts)

Returns the number of full and fractional parts of milliseconds in the TimeSpan ts.

TotalMilliseconds(TimeSpan(0, 0, 0, 7, 500))    // Time interval of 7500 milliseconds
  • InDays(ts)
  • InHours(ts)
  • InMinutes(ts)
  • InSeconds(ts)
  • InMilliseconds(ts)
  • TimeSpan(days, hours, minutes, seconds, milliseconds)
  • TimeSpanParse(s)
  • TotalDays(ts)
  • TotalHours(ts)
  • TotalMinutes(ts)
  • TotalSeconds(ts)
  • TotalMilliseconds(ts)