pro second_to_hms,time_sec,time_str

a=time_sec
nn=n_elements(a)
a=long(a)
hh=a/3600L
a=(a mod 3600L)
mm=a/60L
ss=a-mm*60L
hh=strcompress(string(hh),/remove_all)
mm=strcompress(string(mm),/remove_all)
ss=strcompress(string(ss),/remove_all)
for i=0,nn-1 do begin
if strlen(hh(i)) lt 2 then hh(i)='0'+hh(i)
if strlen(mm(i)) lt 2 then mm(i)='0'+mm(i)
if strlen(ss(i)) lt 2 then ss(i)='0'+ss(i)
endfor
time_str=hh+mm+ss

end 


