DATE can be used as an intrinsic subroutine or as a portability routine.
Intrinsic Subroutine: Returns the current date as set within the system.
Syntax
The date is returned as a 9-byte ASCII character string taking the form dd-mmm-yy, where:
If buf is of numeric type and smaller than 9 bytes, data corruption can occur.
If buf is of character type, its associated length is passed to the subroutine. If buf is smaller than 9 bytes, the subroutine truncates the date to fit in the specified length. If an array of type character is passed, the subroutine stores the date in the first array element, using the element length, not the length of the entire array.
Example
CHARACTER*1 DAY(9)
...
CALL DATE (DAY)
The length of the first array element in CHARACTER array DAY is passed to the DATE subroutine. The subroutine then truncates the date to fit into the 1-character element, producing an incorrect result.
Portability Subroutine and Function: Returns the current system date.
Module: USE DFPORT
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 string 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.
Compatibility
CONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIB
Example
USE DFPORT
!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( )