Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 7/13/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

UNPACKTIMEQQ

Portability Subroutine: Unpacks a packed time and date value into its component parts.

Module

USE IFPORT

CALL UNPACKTIMEQQ (timedate,iyr,imon,iday,ihr,imin,isec)

timedate

(Input) INTEGER(4). Packed time and date information.

iyr

(Output) INTEGER(2). Year ( xxxxAD).

imon

(Output) INTEGER(2). Month (1 - 12).

iday

(Output) INTEGER(2). Day (1 - 31).

ihr

(Output) INTEGER(2). Hour (0 - 23).

imin

(Output) INTEGER(2). Minute (0 - 59).

isec

(Output) INTEGER(2). Second (0 - 59).

GETFILEINFOQQ returns time and date in a packed format. You can use UNPACKTIMEQQ to unpack these values.

The output values reflect the time zone set on the local computer and the daylight savings rules for that time zone.

Use PACKTIMEQQ to repack times for passing to SETFILETIMEQQ. Packed times can be compared using relational operators.

Example

 USE IFPORT
 CHARACTER(80)    file
 TYPE (FILE$INFO) info
 INTEGER(4) handle, result
 INTEGER(2) iyr, imon, iday, ihr, imin, isec

 file = 'd:\f90ps\bin\t???.*'
 handle = FILE$FIRST
 result = GETFILEINFOQQ(file, info, handle)
 CALL UNPACKTIMEQQ(info%lastwrite, iyr, imon,&
                   iday, ihr, imin, isec)
 WRITE(*,*) iyr, imon, iday
 WRITE(*,*) ihr, imin, isec
 END