PreviousNextIndex

+ Datetime addition operator

Adds a number of milliseconds to a DATETIME or a DATETIME-TZ to produce another DATETIME or DATETIME-TZ.

Syntax

datetime + milliseconds 

datetime-tz + milliseconds 

datetime
milliseconds
datetime-tz
Example

This example returns the date and time exactly 24 hours later (dtTime) by calculating and adding the number of milliseconds in 24 hours to the present date and time (NOW function) and displays the result:

DEFINE VARIABLE dtTime AS DATETIME NO-UNDO. 
DEFINE VARIABLE iHour  AS INTEGER  NO-UNDO INITIAL 3600000. 
dtTime = NOW + (24 * iHour). 
MESSAGE "A day later: " dtTime VIEW-AS ALERT-BOX. 

Notes
See also

+ Date addition operator, – Datetime subtraction operator, ADD-INTERVAL function, DATETIME function, DATETIME-TZ function


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex