I am coding in Progress (aka OpenEdge ABL).
I have a variable that holds a time and I want to figure out if it is greater than the current time.
But I cannot find anything in the documentation I've read that shows me how to retrieve the current Time in Progress.
I can only find information about retrieving the current Date (using the Today keyword).
Incidentally, if using the Today keyword includes the time portion of the date, that's fine, but then I would need to know how to isolate just the time portion.
Thanks. (Note that the time I'm referring to is of the type that is an integer representing the seconds since midnight)
Prior to version 10:
define variable t as integer no-undo. /* time, in seconds, since midnite */
t = time.
display t.
After version 10 (if you want combined date & time):
define variable dt as datetime no-undo.
dt = now.
display dt.
Comparing an existing time variable to the current time:
define variable t as integer no-undo initial 12345. /* 3:25:45 am */
display t > time.
Extract the time, in seconds, from a DateTime variable (and display it nicely as Jensd suggests):
define variable t as integer no-undo.
define variable dt as datetime no-undo.
dt = now.
t = integer( mtime( dt ) / 1000 ).
display t string( t, "hh:mm:ss am" ).