Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function SecondsToClock(Seconds)
- local Seconds = tonumber(Seconds)
- if Seconds <= 0 then
- return "00:00:00"
- else
- local Hours = string.format("%02.f", math.floor(Seconds / 3600))
- local Mins = string.format("%02.f", math.floor(Seconds / 60 - (Hours * 60)))
- local Secs = string.format("%02.f", math.floor(Seconds - Hours * 3600 - Mins * 60))
- return Hours..":"..Mins..":"..Secs
- end
- end
- print(SecondsToClock(4))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement