Oracle Solaris Studio 12.4 Man Pages

Exit Print View

Updated: January 2015
 
 

idate(3F)

Name

idate - 以数字形式返回日期

Synopsis

标准版本

subroutine idate(iarray) integer*4 iarray(3)

VMS 版本

subroutine idate(m, d, y) integer*4 m, d, y 

Description

idate 具有标准版本和 VMS 版本。VMS 版本不是 Y2K 安全的。

标准版本

idate 子例程将当前日期放置到整数数组 iarray 中。顺序为:天、月份、年份。月份的范围是 1-12。年份为四位数字,例如 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%

VMS 版本

使用 -lV77 标志编译。

idate 子例程将当前日期放置到整数 mdy 中。VMS 版本仅允许使用 2 位数并且不是 Y2K 安全的。示例:

 
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%

Files

libF77.alibV77.a

Warnings

VMS 版本不是 Y2K 安全的。因为处于 VMS 模式的 idate 会返回一个 2 位数的年份,所以不应当使用它来比较未考虑此情况的日期。 fdate (3F) 和 date_and_time (3F) 返回 4 位数的年份,因此可以改用它们。

因为 idate 不是 Y2K 安全的,所以在 VMS 模式中使用此例程的程序在编译和执行时将生成警告消息。

注意

注意

使用 f77 编译器 -lV77 标志进行编译时,将与 idate()time() 的 VMS 版本相链接。(仅限 f77)

See also

date (3F) 、 fdate (3F) 、 date_and_time (3F)

《FORTRAN 77 Reference Manual》