Script unit that provides time functions.
Methods |
---|
function addHours(value: time, hours: decimal): time Adds hours to a time. |
function addMinutes(value: time, minutes: decimal): time Adds minutes to a time. |
function addSeconds(value: time, seconds: decimal): time Adds seconds to a time. |
function of(hours: decimal, minutes: decimal, day: decimal): time Creates a time given hours, minutes and seconds. |
function fromDatetime(value: datetime): datetime Converts a date and time to a time. |
function seconds(startValue: time, endValue: time): decimal Returns the number of seconds between two times. |
Adds hours to a time. The calculation wraps around midnight.
Parameters :
value: the input time
hours: the number of hours to be added. Must be an integer.
Return :
the new time or null if any parameter is null.
Adds minutes to a time. The calculation wraps around midnight.
Parameters :
value: the input time
minutes: the number of minutes to be added. Must be an integer.
Return :
the new time or null if any parameter is null.
Adds seconds to a time. Fractions of seconds are supported with millisecond precision. The calculation wraps around midnight.
Parameters :
value: the input time
seconds: the number of seconds to be added. Fractions are rounded to three decimal digits.
Return :
the new time or null if any parameter is null.
Creates a time given hours, minutes and seconds. Fractions of seconds are supported with millisecond precision.
Parameters :
hour: the input hour
minute: the input minute
second: the input second. Fractions are rounded to three decimal digits.
Return :
the new time or null if any parameter is null.
Converts a date and time to a time. The date part is ignored.
Parameters :
value: the input date and time
Return :
the new time or null if parameter is null.
Returns the number of seconds between two times.
Parameters :
startValue: the input start date and time inclusive
endValue: the input end date and time exclusive
Return :
the number of seconds or null if any parameter is null. Return value may have a fractional part.