        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/
        DIMENSION TA(9)
        
        CALL GMTIME(TIME(), TA)
C TA(1): SECONDS AFTER MINUTE (0-59) OR (0-61) FOR LEAP SEC
C TA(2): MINUTES AFTER HOUR (0-59)
C TA(3): HOURS PAST MIDNIGHT (0-23)
C TA(4): DAY OF MONTH (0-31)
C TA(5): NUMBER OF MONTH SINCE JAN (0-12)
C TA(6): YEARS SINCE 1900
C TA(7): NUMBER OF DAYS SINCE SUNDAY (0-6)
C TA(8): NUMBER OF DAYS SINCE JAN 1
C TA(9): DAYLIGTH SAVING INDIC. POS IF IN EFFECT, ZERO IF NOT, NEG IF
C        INFORAMATION IS NOT AVAILABLE

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

        RETURN
        END
