This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gfortran,patch] Add ITIME and IDATE intrinsics


> > If not yet done, I could update intrinsic.texi?
> That would be a most welcome contribution!
Done and attached (mostly stripped from g77 manuals).

> Just a simple check: do you have a copyright assignement with the FSF?
Nope. That's first contribution besides problem reports.


Regards
	Daniel
Index: intrinsic.texi
===================================================================
--- intrinsic.texi	(revision 115149)
+++ intrinsic.texi	(working copy)
@@ -100,7 +100,9 @@
 * @code{HUGE}:          HUGE,      Largest number of a kind
 * @code{IACHAR}:        IACHAR,    Code in @acronym{ASCII} collating sequence
 * @code{ICHAR}:         ICHAR,     Character-to-integer conversion function
+* @code{IDATE}:         IDATE,     Current local time (day/month/year)
 * @code{IRAND}:         IRAND,     Integer pseudo-random number
+* @code{ITIME}:         ITIME,     Current local time (hour/minutes/seconds)
 * @code{KIND}:          KIND,      Kind of an entity
 * @code{LOC}:           LOC,       Returns the address of a variable
 * @code{LOG}:           LOG,       Logarithm function
@@ -3294,8 +3296,48 @@
 @end smallexample
 @end table
 
+@node IDATE
+@section @code{IDATE} --- Get current local time subroutine (day/month/year) 
+@findex @code{IDATE} intrinsic
 
+@table @asis
+@item @emph{Description}:
+@code{IDATE(TARRAY)} Fills @code{TARRAY} with the numerical values at the  
+current local time. The day (in the range 1-31), month (in the range 1-12), 
+and year appear in elements 1, 2, and 3 of @code{TARRAY}, respectively. 
+The year has four significant digits.
 
+@item @emph{Option}:
+gnu
+
+@item @emph{Class}:
+subroutine
+
+@item @emph{Syntax}:
+@code{CALL IDATE(TARRAY)}
+
+@item @emph{Arguments}:
+@multitable @columnfractions .15 .80
+@item @var{TARRAY} @tab The type shall be @code{REAL, DIMENSION(3)}.
+@end multitable
+
+@item @emph{Return value}:
+The day, month and year of the current local time.
+
+
+@item @emph{Example}:
+@smallexample
+program test_idate
+  integer, dimension(3) :: tarray
+  call idate(tarray)
+  print *, tarray(1)
+  print *, tarray(2)
+  print *, tarray(3)
+end program test_idate
+@end smallexample
+@end table
+
+
 @node IRAND
 @section @code{IRAND} --- Integer pseudo-random number
 @findex @code{IRAND} intrinsic
@@ -3340,8 +3382,48 @@
 
 @end table
 
+@node ITIME
+@section @code{ITIME} --- Get current local time subroutine (hour/minutes/seconds) 
+@findex @code{ITIME} intrinsic
 
+@table @asis
+@item @emph{Description}:
+@code{IDATE(TARRAY)} Fills @code{TARRAY} with the numerical values at the  
+current local time. The hour (in the range 1-24), minute (in the range 1-60), 
+and seconds (in the range 1-60) appear in elements 1, 2, and 3 of @code{TARRAY}, 
+respectively.
 
+@item @emph{Option}:
+gnu
+
+@item @emph{Class}:
+subroutine
+
+@item @emph{Syntax}:
+@code{CALL ITIME(TARRAY)}
+
+@item @emph{Arguments}:
+@multitable @columnfractions .15 .80
+@item @var{TARRAY} @tab The type shall be @code{REAL, DIMENSION(3)}.
+@end multitable
+
+@item @emph{Return value}:
+The hour, minutes and seconds of the current local time.
+
+
+@item @emph{Example}:
+@smallexample
+program test_itime
+  integer, dimension(3) :: tarray
+  call itime(tarray)
+  print *, tarray(1)
+  print *, tarray(2)
+  print *, tarray(3)
+end program test_itime
+@end smallexample
+@end table
+
+
 @node KIND
 @section @code{KIND} --- Kind of an entity
 @findex @code{KIND} intrinsic

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]