pro time_strip,time_date,time,form ;This program returns either the number of hours, minutes or seconds ;represented by 'time_date' (hh:mm:ss) in the array 'time'. ;time_date is a string array ;time is a floating array ;form is 0 for seconds, 1 for minutes, 2 for hours. sze=size(time_date) nrecords=sze(1) if n_params() LT 3 then form=0 time=fltarr(nrecords) for i=0,nrecords-1 do begin pos=strpos(time_date(i),':')-2 hr=strmid(time_date(i),pos,2) mn=strmid(time_date(i),pos+3,2) sec=strmid(time_date(i),pos+6,2) temp=hr*3600.+mn*60.+sec*1.0 ;print,hr,mn,sec case form of 0: time(i)=temp ;return seconds 1: time(i)=temp/60. ;return minutes 2: time(i)=temp/3600. ;return hours endcase endfor return end