TIME_DELTA
Last updated
Was this helpful?
Last updated
Was this helpful?
The function TIME_DELTA returns returns the number of total hours, total minutes, total seconds, and total milliseconds between two Times.
This function takes two as input. It returns he number of total hours, total minutes, total seconds, and total milliseconds between the two Times. This output is a is formatted like another , but, unlike most , it does not express a valid time of day. Calculation takes into account irregularities such as daylight savings time and leap years.
time1 (required, type: Time) Any time.
time (required, type: Time) Any time.
delta (type: Time) The number of total hours, total minutes, total seconds, and total milliseconds between time1 and time2. Calculation takes into account irregularities such as daylight savings time and leap years. Unlike most , delta does not express a valid time of day.
Assume the following examples have access to the following Time values:
TIME_DELTA returns the absolute difference between the given Times; it does not matter which is given first. The following example returns the the number of hours, minutes, seconds, and milliseconds between example_time2 and example_time1; note that the output is the same as the above example, even though the Time values are given in reverse order:
Assume the following examples have access to example_time1 and example_time2 from the Examples section. The isolated difference between hours, minutes, or seconds (respectively) between them can be found as follows:
The following example returns the the number of hours, minutes, seconds, and milliseconds between example_time1 and example_time2. Note that the values associated with "minute", "second", and millisecond" are too large to be valid values describing a real ; rather, the describe the total number of minutes, seconds and milliseconds (respectively) between the two given Times:
The Time returned by TIME_DELTA does not contain conventional TIME information; while it is technically possible to use it as TIME input in functions such as , the output returned in such cases will not be meaningful. To avoid such confusion, it is best practice to use TIME_DELTA in tandem with the , , or function. (There is no analogous MILLISECOND function; such small differences in time are effectively negligible in the context of real-world apps.) Examples can be found below:
This returns a single : the hours, minutes, or seconds, respectively, between the two times.