Intel® Fortran Compiler 17.0 Developer Guide and Reference
Portability Subroutine: Returns the components of the local time zone time in a nine-element array.
USE IFPORT
CALL LTIME (time,array)
time |
(Input) INTEGER(4). An elapsed time in seconds since 00:00:00 Greenwich mean time, January 1, 1970. |
||||||||||||||||||||
array |
(Output) INTEGER(4). One-dimensional array with 9 elements to contain local date and time data derived from time. The elements of array are returned as follows:
|
This subroutine is not year-2000 compliant, use DATE_AND_TIME instead.
On Linux* and OS X*, time can be a negative number returning the time before 00:00:00 Greenwich mean time, January 1, 1970. On Windows*, time can not be negative, in which case all 9 elements of array are set to -1. On all operating systems, if there is a system error in getting the local time, all 9 elements of array are set to -1.
USE IFPORT
INTEGER(4) input_time, time_array(9)
! find number of seconds since 1/1/70
input_time=TIME()
! convert number of seconds to time array
CALL LTIME (input_time, time_array)
PRINT *, time_array