AddToTime function
Syntax
AddToTime(time, hours, minutes, seconds)
Description
Use the AddToTime function to add hours, minutes, and seconds to time. This function returns the result as a Time value. To subtract from time, use negative numbers for hours, minutes, and seconds. The resulting value is always adjusted such that it represents an hour less than 24 (a valid time of day.)
Parameters
| Parameter | Description |
|---|---|
|
time |
A time value that you want to subtract from or add to. |
|
hours |
An integer representing the number of hours to add to time. |
|
minutes |
An integer representing the number of minutes to add to time. |
|
seconds |
An integer representing the number of seconds to add to time. |
Returns
A Time value equal to time increased by the number of hours, minutes, and seconds passed to the function.
Example
Assume that a time, &BREAKTime, is 0:15:00. The following moves the time &BREAKTime back by one hour, resulting in 23:15:00:
&BREAKTime = AddToTime(&BREAKTime, -1, 0, 0);