      SUBROUTINE GETTIME(TFLAG,SERTIME,EERTIME,SCETIME,EDRTIME)
C
C CONVERT EDR TIME TAGS TO CALENDAR UNITS
C
      CHARACTER*4 TFLAG
      INTEGER*2 SERTIME(6),EERTIME(6),SCETIME(6),EDRTIME(6)
C
      INCLUDE 'UNPACK.INC'    
C
      SERTIME(1) = YEAR1
      CALL CONHOUR(ERTSHR,SERTIME)
      CALL CONSEC(ERTSSC,SERTIME)
      SERTIME(6) = ERTSML
C
      EERTIME(1) = YEAR2
      CALL CONHOUR(ERTEHR,EERTIME)
      CALL CONSEC(ERTESC,EERTIME)
      EERTIME(6) = ERTEML
C
      SCETIME(1) = YEAR3
      CALL CONHOUR(SCETHR,SCETIME)
      CALL CONSEC(SCETSC,SCETIME)
      SCETIME(6) = SCETML
C
C SELECT TIME TYPE FOR EDR TIME
C
      IF (TFLAG.EQ.'ERTS') THEN
       DO I = 1,6
        EDRTIME(I) = SERTIME(I)
       END DO
      ELSE IF (TFLAG.EQ.'ERTE') THEN
       DO I = 1,6
        EDRTIME(I) = EERTIME(I)
       END DO
      ELSE IF (TFLAG.EQ.'SCET') THEN
       DO I = 1,6
        EDRTIME(I) = SCETIME(I)
       END DO
      END IF
C
      RETURN
      END
