Unit core.time

Dernière publication : Aug 10, 2026
Related information

function addHours(value: time, hours: decimal): time

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.

function addMinutes(value: time, minutes: decimal): time

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.

function addSeconds(value: time, seconds: decimal): time

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.

function of(hours: decimal, minutes: decimal, day: decimal): time

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.

function fromDatetime(value: datetime): datetime

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.

function seconds(startValue: time, endValue: time): decimal

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.