C**********************************************************************
C
	SUBROUTINE SYTIME
C
C	AUTO SYSTEM DATE AND TIME ROUTINE for RSX 11M
C
C		This routine gets date and time from the system
C	and stores them as integers in IDAT, and ITIM as follows:
C
C	ITIM(1) = Hour    ITIM(2) = Minute   ITIM(3) = Second
C	IDAT(1) = Month   IDAT(2) = Day      IDAT(3) = Year
C
C======================================================================
C
      INCLUDE 'COMMON.FTN'
C Uses ITIM, IDAT
C Calls IDATE & TIME from the system library.
C
	INTEGER*2 IBUFF(4)
C
C======================================================================
C
C  Obtain the date from the system clock
C
	CALL IDATE( IDAT(1), IDAT(2), IDAT(3) )
C
C  Let the user know if the date has not been set.
	IF(IDAT(3).LT.83) WRITE(ITYP,1000) IDAT,ITIM
1000	FORMAT(/,' >> WARNING << THE SYSTEM DATE IS NOT SET. ',
     1  ' YOU MAY WANT TO ',/,' ABORT AND RESTART, ELSE',
     2	' ACCEPT THE DATE',I3,'/',I2,'/',I2,I3,':',I2,/)
C     2	' ACCEPT THE DATE',I3,'/',I2,'/',I2.2,I3,':',I2.2,/)
C
C
C======================================================================
C
C   STORE TIME IN RELEVANT VARIABLES
C
C  Get the time as a character string in the form hh:mm:ss
	CALL TIME(IBUFF)
C
C  Store time as integers
	DECODE(6,1020,IBUFF) ITIM
1020	FORMAT(I2,X,I2,X,I2)
C
C======================================================================
C
C  DEBUG: SHOW  DATE/TIME CONVERSION
C
D	IF(IBUG.NE.0) WRITE(IBUG,1030) IDAT,ITIM
D1030	FORMAT(' > SYTIME=',I2,'/',I2,'/',I2, I3,':',I2,':',I2)
CD1030	FORMAT(' > SYTIME=',I2,'/',I2,'/',I2.2, I3,':',I2.2,':',I2.2)
C
C======================================================================
C
	RETURN
	END
