SA-MP Forums Archive
Converting Time - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Converting Time (/showthread.php?tid=73108)



Converting Time - StrickenKid - 12.04.2009

does anyone have a script to convert seconds to the format: MIN:SEC

for example: the seconds is 310 so the output would be "5:10"

Thanks for any help!


Re: Converting Time - StrickenKid - 12.04.2009

*bump* anyone? please?


Re: Converting Time - Donny_k - 12.04.2009

This will give you minutes: total_seconds / 60
This will give you seconds: total_seconds % 60

Have a go at it.


Re: Converting Time - StrickenKid - 12.04.2009

ok i did that but it only gives me 1 character for seconds..

like this:

14:9
14:8
14:7
14:6
14:5
14:4
14:3
14:2
14:1
14:0

and it repeats 6 times untill next minute

13:9
13:8 .....

i need it:

14:59
14:58
14:57 ... etc.... :S

EDIT: nevermid... im stupid i put % 10 instead of % 60