Previous Topic Next topic Print topic


Incrementing and Decrementing Times

Restriction: This topic applies to Windows environments only.

When adding durations to times or subtracting durations from times, the results are always times. Overflow or underflow hours are discarded to ensure that the result is always a valid time.

When adding or subtracting hours, only the hours portion of the time is affected. Adding 24 hours to the time '00:00:00' results in the time '24:00:00' while adding 24 hours to any other time results in the same time (for example, adding 24 hours to the time '12:29:37' results in the time '12:29:37').

When adding or subtracting minutes, minutes are changed and if necessary, the hours are changed. The seconds do not change.

When adding or subtracting seconds, seconds are changed and if necessary, the minutes and hours are changed.

Both positive and negative time durations can be added or subtracted. The result is a time that has been incremented (or decremented) by the specified number of hours, minutes and seconds in that order. For example, entering TIME1+x, where x is a positive decimal number, is equivalent to the expression:

TIME1 + HOUR(x)HOURS + MINUTE(x)MINUTES 
  + SECOND(x)SECONDS
Previous Topic Next topic Print topic