Try OpenEdge Now
skip to main content
ABL Data Types Addenda
DATETIME and DATETIME-TZ data types : Datetime arithmetic
 

Datetime arithmetic

You can use the DATETIME, DATETIME-TZ, INTERVAL, and ADD-INTERVAL functions to add and subtract dates and times in your application.
You can add an integer or decimal to a DATETIME or DATETIME-TZ and get a new DATETIME or DATETIME-TZ. This adds milliseconds to the original DATETIME or DATETIME-TZ. All functions that manipulate DATETIME and DATETIME-TZ data ensure that the time part remains within the valid range, adding a day or days to the date part when the time part goes over the number of milliseconds in a day and subtracting a day or days from the date part when the time part goes under the number of milliseconds in a day.
* Adding and subtracting basic datetime values
* Adding and subtracting days plus milliseconds with a datetime value
* Adding, subtracting, and obtaining specific time intervals