Advertisement
BobMe

Military Clock Converter thing 2

Aug 23rd, 2019
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. -- Military clock thing
  2.  
  3. seconds = 2000000000
  4. minutes = 0
  5. hours = 0
  6. days = 0
  7. years = 0
  8.  
  9.  
  10. while seconds >= 60 do
  11. seconds = seconds - 60
  12. minutes = minutes + 1
  13. end
  14.  
  15. while minutes >= 60 do
  16. minutes = minutes - 60
  17. hours = hours + 1
  18. end
  19.  
  20. while hours >= 24 do
  21. hours = hours - 24
  22. days = days + 1
  23. end
  24.  
  25. while days >= 365 do
  26. days = days - 365
  27. years = years + 1
  28. end
  29.  
  30. --Line of strings
  31.  
  32. if seconds < 10 then seconds = "0"..seconds end
  33. if minutes < 10 then minutes = "0"..minutes end
  34. if hours < 10 then hours = "0"..hours end
  35. if days < 10 then days = "0"..days end
  36. if years < 10 then years = "0"..years end
  37.  
  38. print("yy:dd:hh:mm:ss")
  39. print(years..":"..days..":"..hours..":"..minutes..":"..seconds)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement