Next: , Previous: EXPONENT, Up: Intrinsic Procedures


8.56 FDATE — Get the current time as a string

Description:
FDATE(DATE) returns the current date (using the same format as CTIME) in DATE. It is equivalent to CALL CTIME(DATE, TIME8()).

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

DATE is an INTENT(OUT) CHARACTER variable.

Option:
gnu
Class:
subroutine
Syntax:

CALL FDATE(DATE).
DATE = FDATE(), (not recommended).

Arguments:

DATEThe type shall be of type CHARACTER.

Return value:
The current date and time as a string.
Example:
          program test_fdate
              integer(8) :: i, j
              character(len=30) :: date
              call fdate(date)
              print *, 'Program started on ', date
              do i = 1, 100000000 ! Just a delay
                  j = i * i - i
              end do
              call fdate(date)
              print *, 'Program ended on ', date
          end program test_fdate