RE: Time conversion...
- Posted by Al Getz <Xaxo at aol.com> Feb 24, 2001
- 392 views
Hello again "LEVIATHAN", heres some code to convert seconds to hours:minutes:seconds and a demo... include get.e atom ink function secs_To_hours_mins_secs_string(atom sec) integer hour,min,minA,secA secA=floor(sec+.5) --round seconds sec=remainder(secA,60) minA=(secA-sec)/60 min=remainder(minA,60) hour=(minA-min)/60 return sprintf("%04d",hour)& --modify "%04d" for your own use ":"&sprintf("%02d",min)& ":"&sprintf("%02d",sec) end function --demo: atom sec sequence minsec sec=19234.5 --for example minsec=secs_To_hours_mins_secs_string(sec) printf(1,"%s\n",{minsec}) ink=wait_key() Good luck with it. --Al