datetime + milliseconds
datetime-tz + millisecondsThis 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.
new-datetime = DATETIME( DATE(old-datetime) + days,MTIME(old-datetime) + milliseconds ).
new-datetime-tz = DATETIME-TZ( DATE(old-datetime-tz) + days,MTIME (old-datetime-tz) + milliseconds,TIMEZONE(old-dateime-tz) ).
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates. |