Sun Studio 12: Fortran Library Reference

1.4.51.1 time: Get System Time

The time() function is called by:

INTEGER*4 time or INTEGER*8

n = time() Standard Version

Return value 

INTEGER*4

Output 

Time, in seconds, since 0:0:0, GMT, 1/1/70 

 

INTEGER*8

Output 

In 64-bit environments, time returns an INTEGER*8 value

The function time() returns an integer with the time since 00:00:00 GMT, January 1, 1970, measured in seconds. This is the value of the operating system clock.

Example: time(), version standard with the operating system:


demo% cat ttime.f
        INTEGER*4  n, time
        n = time()
        write(*,*) ’Seconds since 0 1/1/70 GMT = ’, n
        end
demo% f95 ttime.f
demo% a.out
 Seconds since 0 1/1/70 GMT =   913240205
demo%