From 1feb2bedae8ea44835043ee2ac41c0cc7ecc80f4 Mon Sep 17 00:00:00 2001 From: Dominique d'Humieres Date: Sun, 18 Dec 2016 19:03:36 +0100 Subject: [PATCH] re PR fortran/78545 (Possible correction to online LTIME documentation) 2016-12-18 Dominique d'Humieres PR fortran/78545 * intrinsic.texi: Fix documentation for GMTIME and LTIME. * intrinsics/date_and_time.c: Fix comments for GMTIME and LTIME. From-SVN: r243785 --- gcc/fortran/ChangeLog | 5 ++++ gcc/fortran/intrinsic.texi | 38 ++++++++++++++++++++------ libgfortran/ChangeLog | 5 ++++ libgfortran/intrinsics/date_and_time.c | 8 +++--- 4 files changed, 43 insertions(+), 13 deletions(-) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index d718a3fbbaf..d7ce88f60dc 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2016-12-18 Dominique d'Humieres + + PR fortran/78545 + * intrinsic.texi: Fix documentation for GMTIME and LTIME. + 2016-12-18 Janus Weil PR fortran/78848 diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi index c253c255bef..300a938e9a1 100644 --- a/gcc/fortran/intrinsic.texi +++ b/gcc/fortran/intrinsic.texi @@ -7157,11 +7157,16 @@ See @code{GETPID} for an example. @table @asis @item @emph{Description}: -Given a system time value @var{TIME} (as provided by the @code{TIME8} +Given a system time value @var{TIME} (as provided by the @code{TIME} intrinsic), fills @var{VALUES} with values extracted from it appropriate to the UTC time zone (Universal Coordinated Time, also known in some countries as GMT, Greenwich Mean Time), using @code{gmtime(3)}. +This intrinsic routine is provided for backwards compatibility with +GNU Fortran 77. In new code, programmers should consider the use of +the @ref{DATE_AND_TIME} intrinsic defined by the Fortran 95 +standard. + @item @emph{Standard}: GNU extension @@ -7186,11 +7191,11 @@ The elements of @var{VALUES} are assigned as follows: seconds @item Minutes after the hour, range 0--59 @item Hours past midnight, range 0--23 -@item Day of month, range 0--31 -@item Number of months since January, range 0--12 +@item Day of month, range 1--31 +@item Number of months since January, range 0--11 @item Years since 1900 @item Number of days since Sunday, range 0--6 -@item Days since January 1 +@item Days since January 1, range 0--365 @item Daylight savings indicator: positive if daylight savings is in effect, zero if not, and negative if the information is not available. @end enumerate @@ -7841,6 +7846,11 @@ 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 @var{VALUES}, respectively. The year has four significant digits. +This intrinsic routine is provided for backwards compatibility with +GNU Fortran 77. In new code, programmers should consider the use of +the @ref{DATE_AND_TIME} intrinsic defined by the Fortran 95 +standard. + @item @emph{Standard}: GNU extension @@ -8650,11 +8660,16 @@ end program test_nan @table @asis @item @emph{Description}: -@code{IDATE(VALUES)} Fills @var{VALUES} with the numerical values at the +@code{ITIME(VALUES)} Fills @var{VALUES} 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 @var{VALUES}, respectively. +This intrinsic routine is provided for backwards compatibility with +GNU Fortran 77. In new code, programmers should consider the use of +the @ref{DATE_AND_TIME} intrinsic defined by the Fortran 95 +standard. + @item @emph{Standard}: GNU extension @@ -9635,10 +9650,15 @@ To stat an open file: @ref{FSTAT}, to stat a file: @ref{STAT} @table @asis @item @emph{Description}: -Given a system time value @var{TIME} (as provided by the @code{TIME8} +Given a system time value @var{TIME} (as provided by the @code{TIME} intrinsic), fills @var{VALUES} with values extracted from it appropriate to the local time zone using @code{localtime(3)}. +This intrinsic routine is provided for backwards compatibility with +GNU Fortran 77. In new code, programmers should consider the use of +the @ref{DATE_AND_TIME} intrinsic defined by the Fortran 95 +standard. + @item @emph{Standard}: GNU extension @@ -9663,11 +9683,11 @@ The elements of @var{VALUES} are assigned as follows: seconds @item Minutes after the hour, range 0--59 @item Hours past midnight, range 0--23 -@item Day of month, range 0--31 -@item Number of months since January, range 0--12 +@item Day of month, range 1--31 +@item Number of months since January, range 0--11 @item Years since 1900 @item Number of days since Sunday, range 0--6 -@item Days since January 1 +@item Days since January 1, range 0--365 @item Daylight savings indicator: positive if daylight savings is in effect, zero if not, and negative if the information is not available. @end enumerate diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index bcd8cd3e24f..a53cc2d7073 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,8 @@ +2016-12-18 Dominique d'Humieres + + PR fortran/78545 + * intrinsics/date_and_time.c: Fix comments for GMTIME and LTIME. + 2016-12-16 Jerry DeLisle PR fortran/78622 diff --git a/libgfortran/intrinsics/date_and_time.c b/libgfortran/intrinsics/date_and_time.c index 66bcd6f8b2b..5e1f1608af2 100644 --- a/libgfortran/intrinsics/date_and_time.c +++ b/libgfortran/intrinsics/date_and_time.c @@ -456,11 +456,11 @@ idate_i8 (gfc_array_i8 *__values) 1. Seconds after the minute, range 0-59 or 0-61 to allow for leap seconds 2. Minutes after the hour, range 0-59 3. Hours past midnight, range 0-23 - 4. Day of month, range 0-31 + 4. Day of month, range 1-31 5. Number of months since January, range 0-11 6. Years since 1900 7. Number of days since Sunday, range 0-6 - 8. Days since January 1 + 8. Days since January 1, range 0-365 9. Daylight savings indicator: positive if daylight savings is in effect, zero if not, and negative if the information isn't available. */ @@ -548,11 +548,11 @@ gmtime_i8 (GFC_INTEGER_8 * t, gfc_array_i8 * tarray) 1. Seconds after the minute, range 0-59 or 0-61 to allow for leap seconds 2. Minutes after the hour, range 0-59 3. Hours past midnight, range 0-23 - 4. Day of month, range 0-31 + 4. Day of month, range 1-31 5. Number of months since January, range 0-11 6. Years since 1900 7. Number of days since Sunday, range 0-6 - 8. Days since January 1 + 8. Days since January 1, range 0-365 9. Daylight savings indicator: positive if daylight savings is in effect, zero if not, and negative if the information isn't available. */ -- 2.30.2