Oracle Solaris Studio 12.4 Man Pages

Exit Print View

Updated: January 2015
 
 

idate(3F)

Name

idate - return date in numerical form

Synopsis

Standard Version

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

VMS version

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

Description

idate has a Standard version and a VMS version. The VMS version is not Y2K-Safe.

Standard Version

The idate subroutine puts the current date into the integer array iarray. The order is: day, month, year. The month is in the range 1-12. The year is four digits, such as 1997, or 2001. Example:

 
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 Version

Compile with -lV77flag.

The idate subroutine puts the current date into the integers m, d, and y. The VMS version allows only 2 digits and is not Y2K-Safe. Example:

 
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.a, libV77.a

Warnings

The VMS version is not Y2K-Safe. Since idate in VMS mode returns a 2-digit year, it should not be used to compare dates without taking this into account. fdate (3F) ) and date_and_time (3F) do return 4-digit years and could be used instead.

Because idate is not Y2K-Safe, programs using this routine in VMS mode will generate warning messages at compilation and execution.

NOTE

Compiling with the f77 compiler -lV77 flag links with the VMS versions of idate() and time(). (f77 only)

See also

date (3F) , fdate (3F) , date_and_time (3F)

FORTRAN 77 Reference Manual