インテル® Fortran コンパイラー 19.0 デベロッパー・ガイドおよびリファレンス

DATE Portability Routine

Portability Function or Subroutine: Returns the current system date. DATE can be used as a portability routine or as an intrinsic procedure. It is an intrinsic procedure unless you specify USE IFPORT.

Module

USE IFPORT

Function Syntax:

result = DATE( )

Subroutine Syntax:

CALL DATE (dstring)

dstring

(Output) CHARACTER. Is a variable or array containing at least nine bytes of storage.

DATE in its function form returns a CHARACTER string of length 8 in the form mm/dd/yy, where mm, dd, and yy are two-digit representations of the month, day, and year, respectively.

DATE in its subroutine form returns dstring in the form dd-mmm-yy, where dd is a two-digit representation of the current day of the month, mmm is a three-character abbreviation for the current month (for example, Jan) and yy are the last two digits of the current year.

CAUTION

The two-digit year return value may cause problems with the year 2000. Use DATE_AND_TIME instead.

Example

USE IFPORT
!If today's date is March 02, 2000, the following
!code prints "02-Mar-00"
CHARACTER(9) TODAY
CALL DATE(TODAY)
PRINT *, TODAY
!The next line prints "03/02/00"
PRINT *, DATE( )

See Also