FNLMath : Utilities : TIMDY
TIMDY
Gets time of day.
Required Arguments
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.
FORTRAN 90 Interface
Generic: CALL TIMDY (IHOUR, MINUTE, ISEC)
Specific: The specific interface name is TIMDY.
FORTRAN 77 Interface
Single: CALL TIMDY (IHOUR, MINUTE, ISEC)
Description
Routine TIMDY is used to retrieve the time of day.
Example
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
Output
 
Hour:Minute:Second = 14 : 34 : 30
The time is 34 minute(s), 30 second(s) past 2 pm.