Returns data from the real-time clock and the date in a form compatible with the representations defined in ISO 8601:1988.
Subroutine
must be scalar and of type default character, and must have a length at least five in order to contain the complete value. It is an INTENT(OUT) argument. Its leftmost five characters are set to a value of the form ±hhmm, where hh and mm are the time difference with respect to Coordinated Universal Time (UTC) in hours and the parts of an hour expressed in minutes, respectively. If no clock is available, they are set to blank.
The value of ZONE may be incorrect if you have not set the time zone on your hardware correctly. You can manually set the TZ environment variable to ensure the time zone is correct.
The following program:
INTEGER DATE_TIME (8) CHARACTER (LEN = 10) BIG_BEN (3) CALL DATE_AND_TIME (BIG_BEN (1), BIG_BEN (2), & BIG_BEN (3), DATE_TIME)
if executed in Geneva, Switzerland on 1985 April 12 at 15:27:35.5, would have assigned the value 19850412 to BIG_BEN(1), the value 152735.500 to BIG_BEN(2), the value +0100 to BIG_BEN(3), and the following values to DATE_TIME: 1985, 4, 12, 60, 15, 27, 35, 500.
Note that UTC is defined by CCIR Recommendation 460-2 (also known as Greenwich Mean Time).