Gets time of day.
IHOUR — Hour of
the day. (Output)
IHOUR is between 0 and
23 inclusive.
MINUTE — Minute
within the hour. (Output)
MINUTE is between 0
and 59 inclusive.
ISEC — Second
within the minute. (Output)
ISEC is between 0 and
59 inclusive.
Generic: CALL TIMDY (IHOUR, MINUTE, ISEC)
Specific: The specific interface name is TIMDY.
Single: CALL TIMDY (IHOUR, MINUTE, ISEC)
Routine TIMDY is used to retrieve the time of day.
The following example uses TIMDY to return the current time. Obviously, the output is dependent upon the time at which the program is run.
USE TIMDY_INT
USE UMACH_INT
IMPLICIT NONE
INTEGER IHOUR, IMIN, ISEC, NOUT
!
CALL TIMDY (IHOUR, IMIN, ISEC)
CALL UMACH (2, NOUT)
WRITE (NOUT,*) 'Hour:Minute:Second = ', IHOUR, ':', IMIN, &
':', ISEC
IF (IHOUR .EQ. 0) THEN
WRITE (NOUT,*) 'The time is ', IMIN, ' minute(s), ', ISEC, &
' second(s) past midnight.'
ELSE IF (IHOUR .LT. 12) THEN
WRITE (NOUT,*) 'The time is ', IMIN, ' minute(s), ', ISEC, &
' second(s) past ', IHOUR, ' am.'
ELSE IF (IHOUR .EQ. 12) THEN
WRITE (NOUT,*) 'The time is ', IMIN, ' minute(s), ', ISEC, &
' second(s) past noon.'
ELSE
WRITE (NOUT,*) 'The time is ', IMIN, ' minute(s), ', ISEC, &
' second(s) past ', IHOUR-12, ' pm.'
END IF
END
Hour:Minute:Second = 14 : 34 : 30
The time is 34 minute(s), 30 second(s) past 2 pm.
Visual Numerics, Inc. PHONE: 713.784.3131 FAX:713.781.9260 |