Converting seconds into minutes and seconds

Klaus Major k_major at os.surf2000.de
Mon Dec 16 08:11:03 EST 2002


Hi Chris and all,

> I want to display the current time of a player
> in minutes and seconds. Is there a function
> available which converts seconds into minutes and seconds?
> e.g.: 90 becomes 1:30


this li'l function will do exactly that.

I wrote it for my players ;-)

function smpte_lite dauer
   set the numberformat to xx
   put dauer div 60 into minu
   put dauer mod 60 into seku
   return minu & ":" & seku
end smpte_lite

Call it with the secs as the argument.

...
   put smpte_lite(90) into fld "duration"
   ### gives "01:30" :-D
...

Have a nice day.


Regards

Klaus Major
k_major at os.surf2000.de




More information about the Use-livecode mailing list