subroutine idate(iarray) integer*4 iarray(3)
subroutine idate(m, d, y) integer*4 m, d, y
idate には、標準バージョンと VMS バージョンがあります。VMS バージョンは 2000 年問題に対応していません。
idate サブルーチンは、現在の日付を整数配列 iarray に格納します。順序は日、月、年です。月は 1-12 の範囲です。年は 4 桁 (1997 や 2001 など) です。例:
demo% cat ida2.f integer*4 a(3) call idate( a ) write(*, "(' The date is: ',3i5)" ) a end demo% f77 -silent ida2.f demo% a.out The date is: 23 1 1997 demo%
-lV77 フラグを使用してコンパイルします。
idate サブルーチンは、現在の日付を整数 m、d、y に格納します。VMS バージョンでは 2 桁しか使用できず、2000 年問題に対応していません。例:
demo% cat ida1.f integer*4 m, d, y call idate( m, d, y ) write(*, "(' The date is: ',3i3)" ) m, d, y end demo% f77 ida1.f -lV77 ida1.f: MAIN: "ida1.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 23 97 demo%
libF77.a、libV77.a
VMS バージョンは 2000 年問題に対応していません。VMS モードの idate は 2 桁の年を返すため、これを考慮せずに日付の比較に使用しないようにしてください。 fdate (3F) ) および date_and_time (3F) は 4 桁の年を返すため、代わりに使用できます。
idate は 2000 年問題に対応していないため、このルーチンを VMS モードで使用するプログラムでは、コンパイル時および実行時に警告メッセージが生成されます。
f77 コンパイラの -lV77 フラグを使用してコンパイルすると、idate() と time() の VMS バージョンがリンクされます (f77 のみ)。
date (3F) , fdate (3F) , date_and_time (3F)
FORTRAN 77 リファレンスマニュアル