Documentation of LTIME
Janus Weil
janus@gcc.gnu.org
Sat Nov 26 13:04:00 GMT 2016
2016-11-26 13:45 GMT+01:00 Manfred Schwarb <manfred99@gmx.ch>:
> I tried g77, and it gives the same result, 10 and 26.
> So it's this way since ages.
>
> And it makes sense, as ltime seems to be a simple wrapper around localtime(3),
> and the manual page for localtime states:
>
> tm_mon The number of months since January, in the range 0 to 11.
and
tm_mday The day of the month, in the range 1 to 31.
That's a pretty funny definition, though. Why do you let the days
start from one, but the months start from zero? I really wonder how
that came about ...
Note than gfortran also has the (non-standard) intrinsic IDATE, which
has the days and months starting from 1 and is documented that way:
https://gcc.gnu.org/onlinedocs/gfortran/IDATE.html
Its implementation in libgfortran/intrinsics/date_and_time.c also uses
a call to 'localtime', but then adds 1 to the month ;)
Cheers,
Janus
More information about the Fortran
mailing list