Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Current Time in Progress (OpenEdge)

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)

like image 513
user2592449 Avatar asked Dec 15 '22 08:12

user2592449


1 Answers

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" ).
like image 69
Tom Bascom Avatar answered Jan 28 '23 23:01

Tom Bascom