        SUBROUTINE DATIME(D,T)

C  RETURN THE DATE AND TIME IN D AND T.  D IS NUMBER OF DAYS SINCE 01-JAN-77,
C  T IS MINUTES PAST MIDNIGHT.  THIS IS HARDER THAN IT SOUNDS, BECAUSE THE
C  FINAGLED DEC FUNCTIONS RETURN THE VALUES ONLY AS ASCII STRINGS!

        IMPLICIT INTEGER(A-Z)
        DIMENSION DAT(4),HATH(12)
C       DATA MONTHS/'-JAN-','-FEB-','-MAR-','-APR-','-MAY-','-JUN-',
C    1       '-JUL-','-AUG-','-SEP-','-OCT-','-NOV-','-DEC-'/
        DATA HATH/31,28,31,30,31,30,31,31,30,31,30,31/

        CALL TIMDAT(DAT,4)
        T=DAT(4)
        D=(RS(DAT(2),8)-:260)*10+RT(DAT(2),8)-:260
        Y=(RS(DAT(3),8)-:260)*10+(RT(DAT(3),8)-:260)
      Y=Y-77
        M=(RS(DAT(1),8)-:260)*10+RT(DAT(1),8)-:260
        DO 1 I=1,12
        IF(I.EQ.M)GO TO 2
1       D=D+HATH(I)
        CALL BUG(28)

2       D=D+Y*365-1

        RETURN
        END
