pro convert_unix_time,s_unix,dt_char,mon,day,yr,doy,time ;----------------------------------------------------------------- ; Convert time as seconds since Unix epoch to real world time ; ; Input: ; s_unix....seconds since Unix epoch ; ; Output: ; dt_char...date - time info as a character: day-of-week month date hh:mm:ss year ; mon.......integer month ; day.......integer day of month ; yr........integer year ; doy.......integer day of year ; time......UTC time of day, hh.hh ; ; Routines used: cmsystime.pro, juldat2.pro ; ; Source: Mark Hervig, GATS Inc. ; ;----------------------------------------------------------------- mos = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun','Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] dt_char = cmsystime(s_unix) & dt_char = dt_char(0) m = strmid(dt_char,4,3) k = where(m eq mos) mon = k(0) + 1 day = fix(strmid(dt_char,7,3)) h = float(strmid(dt_char,11,2)) m = float(strmid(dt_char,14,2)) s = float(strmid(dt_char,17,2)) time = h + m/60. + s/3600. yr = fix(strmid(dt_char,20,4)) juldat2,mon,day,yr,juld,cdate,doy ;- done return end