On Thu, 27 Apr 2006 13:18:02 -0400, Jim Bohnsack <[EMAIL PROTECTED]> wro
te:

>Apparently I don't have the "'modern' date() and time() functions" or at

>least not the time() function that Mike specified.  Is there still an ex
tra
>library such as the one that Princeton (I think) used to supply?  I'm on

>z/VM 4.4.
>Jim

Not that I've heard of. 

>>time=time('n', thensecs, 's')

This would work like this:

if thensecs >= 86400 then Syntax Error
else time = right(thensecs//3600,2,0)':'right(thensecs//60%60,2,0)':'ri
ght(thensecs%60,2,0)

From the Regina 3.3 Manual:

TIME([option_out [,time [option_in]]]) - (ANSI) 
Returns a string containing information about the time. To get the time i
n a particular format, an 
option_out can be specified. The default option_out is Normal. The meanin
g of the possible 
options are: 
[C] 
(Civil) Returns the time in civil format.  The return value might be "hh:
mmXX", where XX 
are either am or pm. The hh part will be stripped of any leading zeros, a
nd will be in the 
range 1-12 inclusive. 
[E] 
(Elapsed) Returns the time elapsed in seconds since the internal stopwatc
h was started.  The 
result will not have any leading zeros or blanks.  The output will be a f
loating point number 
with six digits after the decimal point. 
[H] 
(Hours) Returns the number of complete hours that have passed since last 
midnight in the 
form "hh". The output will have no leading zeros, and will be in the rang
e 0-23. 
[L] 
(Long) Returns the exact time, down to the microsecond. This is called th
e long format. The 
output might be "hh:mm:ss.mmmmmm".  Be aware that most computers do not h
ave a 
clock of that accuracy, so the actual granularity you can expect, will be
 about a few 
milliseconds. The hh, mm and ss parts will be identical to what is return
ed by the options H, 
M and S respectively, except that each part will have leading zeros as in
dicated by the 
format. 
[M] 
(Minutes) Returns the number of complete minutes since midnight, in a for
mat having no 
leading spaces or zeros. 
[N] 
(Normal) The output format is "hh:mm:ss", and is padded with zeros if nee
ded. The hh, 
mm and ss will contain the hours, minutes and seconds, respectively. Each
 part will be 
padded with leading zeros to make it double-digit. 
[R] 
(Reset) Returns the value of the internal stopwatch just like the E optio
n, and using the same 
format. In addition, it will reset the stopwatch to zero after its conten
ts has been read. 
[S] 
(Seconds) Returns the number of complete seconds since midnight, in a for
mat having no 
leading spaces or zeros. 
[T] 
(time_t) Returns the current date/time in UNIX time_t format.  time_t is 
the number of 
seconds since January 1st 1970. 
Note that the time is never rounded, only truncated. As shown in the exam
ples below, the seconds 
do not get rounded upwards, even though the decimal part implies that the
y are closer to 59 than 
to 
58. The same applies for the minutes, which are closer to 33 than to 32, 
but is truncated to 32. 
None of the formats will have leading or trailing spaces. 
Assuming that the time is exactly 14:32:58.987654 on March 30th 2002, the
 following will be 
true: 
TIME('C') '2:32pm' 
TIME('E') '0.01200' /* Maybe */ 
TIME('H') '14' 
TIME('L') '14:32:58.987654' 
TIME('M') '32' 
TIME('N') '14:32:58' 
TIME('R') '0.430221' /* Maybe */ 
TIME('S') '58' 
If the time option is specified, the function provides for time conversio
ns.  The optional option_in 
specifies the format in which time is supplied.  The possible values for 
option_in are:  CHLMNS. 
The default value for option_in is N. 
TIME('C','11:27:21') '11:27am' 
TIME('N','11:27am','C') '11:27:00' 
The time conversion capability of the TIME BIF was introduced with the AN
SI standard. 

Reply via email to