AddToTime PeopleCode Built-in Function

No votes yet

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
value
is always adjusted such that it represents an hour less than 24 (example: 18:45)

Syntax
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!

Comments

Have a question? Please ask it on the forum instead.

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
The question below is to prevent automated spam submissions.
10 + 10 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.