The function ctime converts a system time, stime, and returns it as a 24-character ASCII string.
CHARACTER ctime*24 string = ctime( stime ) |
|||
---|---|---|---|
stime |
INTEGER*4 |
Input |
System time from time() (standard version) |
Return value |
character*24 |
Output |
System time as character string. Declare ctime and string as character*24. |
The format of the ctime returned value is shown in the following example. It is described in the man page ctime(3C).
character*24 ctime, string INTEGER*4 n, time n = time() string = ctime( n ) write(*,*) 'ctime: ', string end demo% f77 -silent tctime.f demo% a.out ctime: Wed Dec 9 13:50:05 1998 demo%