function [jday,hour,min,sec,msec]=secs2jhms(secs) %%%%function [jday,hour,min,sec,msec]=secs2jhms(secs) %%%%This function converts decimal seconds referenced to the beginning of %%%%the year (or 1970) into Julian time jday_tmp = secs/24/60/60; jday = floor(jday_tmp); hour_tmp = (jday_tmp - jday)*24; jday = jday + 1; hour = floor(hour_tmp); min_tmp = (hour_tmp - hour)*60; min = floor(min_tmp); sec_tmp = (min_tmp - min)*60; sec = floor(sec_tmp); msec = round((sec_tmp - sec)*1000); if msec==1000; msec=0; sec=sec+1; end if sec==60; sec=0; min=min+1; end if min==60; min=0; hour=hour+1; end if hour==24; hour=0; jday=jday+1; end %%% check to see if the input seconds are refenced to 1970 if jday>365; jday = jday-12784; end