CTIME
converts a system time value, such as returned by TIME8
, to a string. The output will be of the form ‘Sat Aug 19 18:13:14 1995
’. This intrinsic is provided in both subroutine and function forms; however, only one form can be used in any given program unit.
CALL CTIME(TIME, RESULT) . |
RESULT = CTIME(TIME) . |
TIME | The type shall be of type INTEGER . |
RESULT | The type shall be of type CHARACTER and of default kind. It is an INTENT(OUT) argument. If the length of this variable is too short for the time and date string to fit completely, it will be blank on procedure return. |
program test_ctime integer(8) :: i character(len=30) :: date i = time8() ! Do something, main part of the program call ctime(i,date) print *, 'Program was started on ', date end program test_ctime
© Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.
https://gcc.gnu.org/onlinedocs/gcc-6.3.0/gfortran/CTIME.html