Documentation of LTIME

Francisco Pena fran.pena@usc.es
Sat Nov 26 12:00:00 GMT 2016


Moreover, it seems that STAT(modification time)+LTIME returns months
in 0-11 and days of the month in 1-31.

I have compiled the program in Linux:

program p
implicit none
integer(4) :: st, buffer(13)
integer :: ltval(9)
st = stat('a.txt', buffer)
call ltime(buffer(10), ltval) !modification time
print*,'Month: ', ltval(5)
print*,'Day: ', ltval(4)
end program

The results are:

$ date
Sat Nov 26 12:51:16 CET 2016
$ touch a.txt
$ ./a.out
 Month:           10
 Day:           26

I have used gfortran 4.8.2. Sorry, I cannot say whether newer versions
reproduce the result or not.

Best,
Francisco Pena

2016-11-26 12:24 GMT+01:00 Francisco Pena <fran.pena@usc.es>:
> Hi,
>
> In the online documentation of LTIME,
> https://gcc.gnu.org/onlinedocs/gfortran/LTIME.html#LTIME, is written:
>
> Return value:
>     The elements of VALUES are assigned as follows:
>
>         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
>         5. Number of months since January, range 0–12
>
> I imagine that range should be 0-30 for 4. and 0-11 for 5.
>
> Best regards,
> Francisco Pena



-- 

Francisco José Pena Brage
Departamento de Matemática Aplicada
Facultade de Matemáticas. Campus Vida
15782 Santiago de Compostela - Spain
Tel.: +34 8818 13194
Fax: +34 8818 13197
Email: fran(dot)pena(at)usc(dot)es
http://www.usc.es/ingmat



More information about the Fortran mailing list