Datetime arithmetic
- Last Updated: December 3, 2025
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
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.