	FUNCTION Time2Dset, idx, stTime, enTime, idxList
;	------------------------------------------------------------
;+							24-June-1991
;	Name:
;		Time2Dset
;	Purpose: 
;		Given start time (stTime) and end time (enTime)
;		search (idx) and return a list of indices (idxList)
;		which occur between those times.
;	CALLING SEQUENCE:
;		err = Time2Dset( idx, stTime, enTime, idxList)
;	Input:
;		idx	data vector to be search containning time
;			fields
;		stTime	start time of search
;		enTime	end time of search
;
;		Input start and end times are assumed to be in internal
;		format and are structured vars. with fields time and 
;		day.  For example,
;			stTime = {Low , time = LONG(0), day = FIX(0)}
;
;		        stTime.time  is milliseconds of day 
;			stTime.day   is days since 1-1-79
;	Output:
;		idxList	list of data vector indices which occur 
;			between the input times.
;	Returned:
;		Time2Dset = 1 	indicates Success
;		Time2Dset = 0	indicates failure to find any elements
;				which satisfy the input constraints.
;
;	SCOPE:  The following structures are legal search parameters:
;		From the SDA file: SXT_RoadMap_Rec, SXT_Index_Rec, and
;		From the Observing Log File: Obs_FileID_Rec, 
;		Obs_3Instr_Rec, Obs_***_Status_Rec, and Obs_SXT_Rec.
;	History:
;		written 18-Apr-1991 by GAL
;		modified with name change from BiSeaTime.pro 24/6/91.
;-
;	------------------------------------------------------------
;	ON_ERROR, 2	;force a return to caller on error

;	Find the element which corresponds to start time:
	i1 = BinarySea(errStat1, stTime, idx.day, idx.time)	

;	Find the element which corresponds to end time:	
	i2 = BinarySea(errStat2, enTime, idx.day, idx.time)	

	IF ((errStat1 ne 0) AND (errStat2 ne 0)) THEN BEGIN	;success
	  ret = 1
	  idxList = INDGEN(i2 - i1 + 1) + i1
	ENDIF ELSE BEGIN
	  ret = 0
	ENDELSE

	RETURN, ret
	END
