pro time_convert,time_in,date,hhmmss=hhmmss,time=time ; ; This converts times given in seconds since 1st Jan 1970 ; to the actual date and time. ; Input times may be scalar or arrays. ; numdays=long(time_in/86400) time=long(time_in)-(86400*numdays) hh=time/3600 mm=(time-hh*3600)/60 ss=time-hh*3600-mm*60 hhmmss=hh*10000+mm*100+ss ; ; This is the decimal time in hours: time=time/3600. baseday=julday(01,01,1970) len_time=size(time_in) if (len_time(0) eq 0) then begin caldat,numdays+baseday,mm,dd,yy date=(yy-1900)*10000 + mm*100 + dd endif else begin len_time=len_time(1) date=lonarr(len_time) for i=0,len_time-1 do begin caldat,numdays(i)+baseday,mm,dd,yy date(i)=(yy-1900)*10000 + mm*100 + dd endfor endelse end