AddToTime PeopleCode Built-in Function

Your rating: None Average: 1 (2 votes)

You can use the AddToTime function to add hours, minutes, and/or
seconds to time. This function returns the result as a Time value. To
subtract from time, you can simply use negative numbers. The resulting
is always adjusted such that it represents an hour less than 24 (example: 18:45)

AddToTime(time, hours, minutes, seconds)

So, how does it look like using an example?

&current_time = 19:20:05. The below code will move the time ahead 1 hr, 5 minutes and 10 sec resulting in 20:25:15
&future_time = AddToTime(&current_time, 1, 5, 10);
&future_time = AddToTime(&current_time, 1, 0,0); (only one hr ahead 20:20:05)
&future_time = AddToTime(&current_time, 1, -5,0); (only one hr ahead and 5 minutes back 20:15:05)

Please try to help out with unanswered topics on the forum. Chances are you have had the same issue/question some time in your IT career!