So I'm trying to take a time in seconds ex: 120 and turn it into 2:00, I keep getting crazy results though.
function splittime(length) --magic rite local seconds = tonumber(length) local minutes = 0 local hours = 0 for i = 1, tonumber(length) do seconds = i if i >= 60 then seconds = seconds - 60 minutes = minutes + 1 end end print("Hours: "..hours,"Minutes: "..minutes,"Seconds: "..seconds) end
OUTPUT: Hours: 0 Minutes: 205 Seconds: 204 --Not sure how long it is but it's definitely NOT 205 minutes