*
* $Id$
*
* $Log$
* Revision 1.1  1996/03/07 15:18:16  mclareni
* Initial revision
*
*
#include "fatmen/pilot.h"
      SUBROUTINE FMDTRN(CHRAN,IDATE,ITIME,JDATE,JTIME,IC)
*CMZ :          24/05/91  13.21.20  by  Jamie Shiers
*-- Author :    Jamie Shiers   24/05/91
*     Convert character date & time range into integer format
*      yymmdd = yymmdd until now
*     -yymmdd = beginning of time until yymmdd
*     .hhmm   = hhmm on first day of Universe/today depending on position
*
      CHARACTER*(*) CHRAN
 
      IC    = 0
      IDATE = 0
      ITIME = 0
      CALL DATIME(JDATE,JTIME)
 
      LCHRAN = LENOCC(CHRAN)
 
      IF(LCHRAN.EQ.0) THEN
         IC = -1
         RETURN
      ENDIF
*
*     Start date and time?
*
      IMINUS = INDEX(CHRAN(1:LCHRAN),'-')
 
      IF(IMINUS.EQ.1) GOTO 10
 
      IF(IMINUS.EQ.0) THEN
         IDOT   = INDEX(CHRAN(1:LCHRAN),'.')
      ELSE
         IDOT   = INDEX(CHRAN(1:IMINUS-1),'.')
      ENDIF
 
      IDATE  = ICDECI(CHRAN,1,LCHRAN)
 
      IF(IDOT.NE.0) ITIME = ICDECI(CHRAN,IDOT+1,LCHRAN)
      IF((IMINUS.EQ.0).OR.(IMINUS.EQ.LCHRAN)) RETURN
 
10    CONTINUE
 
      ISTART = IMINUS + 1
      JDOT   = INDEX(CHRAN(ISTART:LCHRAN),'.')
      IF(JDOT.NE.1) JDATE  = ICDECI(CHRAN,ISTART,LCHRAN)
      IF(JDOT.NE.0) THEN
         JTIME = ICDECI(CHRAN,ISTART+JDOT,LCHRAN)
      ELSE
         JTIME = 0
      ENDIF
 
      END
