function intextime,days79,msecday ; declare variables ; msecday = long(msecday) days79 = long(days79) ; nent = n_elements(days79) bsdtime = lonarr(7,nent); mins = 0; secs = 0; ehrs = 0; emns = 0; escs = 0; emss = 0; edys = 0; emhs = intarr(nent); eyrs = intarr(nent); quit = 0; ; ; declare months array. ; j f m a m j j a s o n d month = [31,28,31,30,31,30,31,31,30,31,30,31] ; ; convert msecday to hrs mins secs + msecs ; secs = msecday/1000 mins = secs/60 ehrs = mins/60 emns = mins - (ehrs*60) escs = secs - (mins*60) emss = msecday - (secs*1000) ; ; convert into date including leap yrs. ; eyrs(*) = 79 edys = days79 quit = 0 while (quit eq 0) do begin alph = ((eyrs mod 4) eq 0) beta = ((edys - (alph + 365)) > 0) ge 1 if (Total(beta) eq 0) then quit = 1 eyrs = eyrs + beta edys = edys - beta*(alph + 365) endwhile ; ; set days in february, and do months ; alph = ((eyrs mod 4) eq 0); /* this is a leap year */ mnth = 0; emhs(*) = 0; /* conclusive proof that the calendar was designed by a quit = 0; * fortran nut, as everyone really knows january is month zero..*/ while (quit eq 0) do begin beta = edys - month(mnth) if (mnth eq 1) then beta = beta - alph; leap year gamm = (beta > 0) ge 1 if (total(gamm) eq 0) then quit = 1 emhs = emhs + gamm edys = edys - gamm * (month(mnth)+(alph*(mnth eq 1))); /* only add 4 feb */ mnth = mnth + 1 endwhile emhs = emhs + 1; ; ; construct output array. ; bsdtime = [[ehrs],[emns],[escs],[emss],[edys],[emhs],[eyrs]] bsdtime = transpose(bsdtime); same format as before (date,ndset) bsdtime = long(bsdtime) ; ; This is where MKC checks the time. and I don't. ; ; Return, and Terminate ; return,bsdtime end