IDATE can be used as an intrinsic subroutine or as a portability subroutine. It is an intrinsic procedure unless you specify USE IFPORT.
The two-digit year return value may cause problems with the year 2000. Use DATE_AND_TIME instead.
Intrinsic Subroutine: Returns three integer values representing the current month, day, and year.
Syntax
CALL IDATE (i, j, k)
i
Is the current month.
j
Is the current day.
k
Is the current year.
The current month is returned in i; the current day in j. The last two digits of the current year are returned in k.
Example
If the current date is September 16, 1996, the values of the integer variables upon return are: I = 9, J = 16, and K = 96.
Portability Subroutine: Returns the month, day, and year of the current system.
Module: USE IFPORT
Syntax
CALL IDATE (i, j, k)
-or-
CALL IDATE (iarray)
i
(Output) INTEGER(4). Current system month.
j
(Output) INTEGER(4). Current system day.
k
(Output) INTEGER(4). Current system year as an offset from 1900.
iarray
(Output) INTEGER(4). Three-element array that holds day as element 1, month as element 2, and year as element 3. The month is between 1 and 12. The year is greater than or equal to 1969 and is returned as 2 digits.
Compatibility
CONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIB
See Also
Example
use IFPORT
integer(4) imonth, iday, iyear, datarray(3)
! If the date is July 11, 1999:
CALL IDATE(IMONTH, IDAY, IYEAR)
! sets IMONTH to 7, IDAY to 11 and IYEAR to 99.
CALL IDATE (DATARRAY)
! datarray is (/11,7,99/)