Adds a number of days to a date, producing a date result.
The r-dadd.p procedure finds all unshipped orders that are at least one week overdue. If the order is not shipped and the promised date is more than seven days ago, the procedure finds the record for the customer who placed the order and displays the order and customer data.
r-dadd.p
The DATETIME function ensures that the time portion remains within the valid range, by adding day(s) to the date part when the time part goes over the number of milliseconds in a day.
new-datetime-tz = DATETIME-TZ( DATE(old-datetime-tz) + days, MTIME (old-datetime-tz) + milliseconds, TIMEZONE(old-dateime-tz) ). |
The DATETIME-TZ function ensures that the time portion remains within the valid range, by adding day(s) to the date portion when the time part goes over the number of milliseconds in a day.