Intrinsic Subroutine: Returns character data on the real-time clock and date in a form compatible with the representations defined in Standard ISO 8601:1988.
Syntax
CC | Is the century |
YY | Is the year within the century |
MM | Is the month within the year |
DD | Is the day within the month |
hh | Is the hour of the day |
mm | Is the minutes of the hour |
ss.sss | Is the seconds and milliseconds of the minute |
UTC (also known as Greenwich Mean Time) is defined by CCIR Recommendation 460-2.
values (1) | The 4-digit year |
values (2) | The month of the year |
values (3) | The day of the month |
values (4) | The time difference with respect to Coordinated Universal Time (UTC) in minutes |
values (5) | The hour of the day (range 0 to 23) - local time |
values (6) | The minutes of the hour (range 0 to 59) - local time |
values (7) | The seconds of the minute (range 0 to 59) - local time |
values (8) | The milliseconds of the second (range 0 to 999) - local time |
Compatibility
CONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIB
See Also: GETDAT, GETTIM, IDATE, FDATE, TIME, ITIME, RTC, CLOCK
Example
Consider the following example executed on 2000 March 28 at 11:04:14.5:
INTEGER DATE_TIME (8)
CHARACTER (LEN = 12) REAL_CLOCK (3)
CALL DATE_AND_TIME (REAL_CLOCK (1), REAL_CLOCK (2), &
REAL_CLOCK (3), DATE_TIME)
This assigns the value "20000328" to REAL_CLOCK (1), the value "110414.500" to REAL_CLOCK (2), and the value "-0500" to REAL_CLOCK (3). The following values are assigned to DATE_TIME: 2000, 3, 28, -300, 11, 4, 14, and 500.
The following shows another example:
CHARACTER(10) t
CHARACTER(5) z
CALL DATE_AND_TIME(TIME = t, ZONE = z)