idate has two versions:
Standard--Put the current system date into an integer array: day, month, and year.
VMS--Put the current system date into three integer variables: month, day, and year. This version is not "Year 2000 Safe".
The -lV77 compiler option request the VMS library and links the VMS versions of both time() and idate(); otherwise, the linker accesses the standard versions.
The standard version puts the current system date into one integer array: day, month, and year.
call idate( iarray ) Standard Version |
|||
---|---|---|---|
iarray |
INTEGER*4 |
Output |
array(3). Note the order: day, month, year. |
Example: idate (standard version):
demo% cat tidate.f INTEGER*4 iarray(3) call idate( iarray ) write(*, "(' The date is: ',3i5)" ) iarray end demo% f77 -silent tidate.f demo% a.out The date is: 10 8 1998 demo%
The VMS idate() subroutine is called by:
call idate( m, d, y ) VMS Version |
|||
---|---|---|---|
m |
INTEGER*4 |
Output |
Month (1 - 12) |
d |
INTEGER*4 |
Output |
Day (1 - 7) |
y |
INTEGER*4 |
Output |
Year (1 - 99) Not year 2000 safe! |
Using the VMS idate() routine will cause a warning message at link time and the first time the routine is called in execution.
The VMS version of the idate() routine is not "Year 2000 Safe" because it returns only a two-digit value for the year. Programs that compute differences between dates using the output of this routine may not work properly after 31 December, 1999. Programs using this idate() routine will see a runtime warning message the first time the routine is called to alert the user. See date_and_time() as a possible alternate.
demo% cat titime.f INTEGER*4 m, d, y call idate ( m, d, y ) write (*, "(' The date is: ',3i5)" ) m, d, y end demo% f77 -silent tidateV.f -lV77 "titime.f", line 2: Warning: Subroutine "idate" is not safe after year 2000; use "date_and_time" instead demo% a.out Computing time differences using the 2 digit year from subroutine idate is not safe after year 2000. The date is: 7 10 98