      PROGRAM CURRENT_TIME
C     This program types out the current time
      LOGICAL SYS$GETTIM,SYS$ASCTIM,I
C     binary system time is quadword
      INTEGER*4 NOW(2)     
C     full system time fills 23 characters
      CHARACTER*23 TIME    
C     first, get the binary representation
C        of the current time
C     output quadword passed by reference
      I = SYS$GETTIM(NOW)  
      IF(.NOT.I)STOP 'COULDN''T GET CURRENT TIME'  
C     always check for error
C     next, convert the binary time to ascii
C     output longword by ref, output char string
C        by descr, input quadword by ref
      I = SYS$ASCTIM(LENGTH,TIME,NOW,)
      IF(.NOT.I)STOP 'COULDN''T CONVERT TIME'
C     Now, display the result
C     7 is the Ascii code for bell.
      TYPE *,'At the sound of the tone the'//
     &   ' time will be',TIME(1:LENGTH),CHAR(7)
      STOP
      END
