Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.45 KB | None | 0 0
  1. function SecondsToClock(Seconds)
  2.         local Seconds = tonumber(Seconds)
  3.  
  4.         if Seconds <= 0 then
  5.             return "00:00:00"
  6.         else
  7.             local Hours = string.format("%02.f", math.floor(Seconds / 3600))
  8.             local Mins = string.format("%02.f", math.floor(Seconds / 60 - (Hours * 60)))
  9.             local Secs = string.format("%02.f", math.floor(Seconds - Hours * 3600 - Mins * 60))
  10.             return Hours..":"..Mins..":"..Secs
  11.          end
  12.     end
  13. print(SecondsToClock(4))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement