Progress
Language Reference


TIME Function

Interfaces
OS
SpeedScript
All
All
Yes

Returns the number of seconds since midnight. Use this function together with the STRING function to produce the time in hours, minutes, and seconds.

SYNTAX

TIME 

EXAMPLES

In r-time.p, the timeleft variable is set to the result of the TIME function subtracted from the number of seconds in a day. The procedure translates this value into seconds, minutes, and hours.

r-time.p
DEFINE VARIABLE hour AS INTEGER.
DEFINE VARIABLE minute AS INTEGER.
DEFINE VARIABLE sec AS INTEGER.
DEFINE VARIABLE timeleft AS INTEGER.

timeleft = (24 * 60 * 60) - TIME.  

/* seconds till next midnight */
sec = timeleft MOD 60.
timeleft = (timeleft - sec) / 60.  

/* minutes till next midnight */
minute = timeleft MOD 60.

/* hours till next midnight */
hour = (timeleft - minute) / 60.   

DISPLAY "Time to midnight:" hour  minute  sec . 

This DISPLAY statement displays the current time.

r-time2.p
DISPLAY STRING(TIME,"HH:MM:SS"). 

SEE ALSO

ETIME Function, STRING Function, TODAY Function


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095