Next: , Previous: CSHIFT, Up: Intrinsic Procedures


8.37 CTIME — Convert a time into a string

Description:
CTIME(T,S) converts T, a system time value, such as returned by TIME8(), to a string of the form `Sat Aug 19 18:13:14 1995', and returns that string into S.

If CTIME is invoked as a function, it can not be invoked as a subroutine, and vice versa.

T is an INTENT(IN) INTEGER(KIND=8) variable. S is an INTENT(OUT) CHARACTER variable.

Option:
gnu
Class:
subroutine
Syntax:

CALL CTIME(T,S).
S = CTIME(T), (not recommended).

Arguments:

SThe type shall be of type CHARACTER.
TThe type shall be of type INTEGER(KIND=8).

Return value:
The converted date and time as a string.
Example:
          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