Module:Time: Difference between revisions

Created page with " -- 123 => 00:02:03 function p.secondsToHMS(s) local ONE_DAY = 24 * 60 * 60 if s > ONE_DAY then return string.format('%d day%s, ', s/ONE_DAY, (math.floor(s/ONE_DAY) > 1) and "s" or "") .. os.date("!%X", s) else return os.date("!%X", s) end end -- 123 => 2 minutes, 3 seconds function p.secondsToHuman(s) if s < 60 then if s > 0 or s < 0 then return string.format('%.1f seconds', s) else return string.format('0 seconds', s) end end local days = math.f..."
(Created page with " -- 123 => 00:02:03 function p.secondsToHMS(s) local ONE_DAY = 24 * 60 * 60 if s > ONE_DAY then return string.format('%d day%s, ', s/ONE_DAY, (math.floor(s/ONE_DAY) > 1) and "s" or "") .. os.date("!%X", s) else return os.date("!%X", s) end end -- 123 => 2 minutes, 3 seconds function p.secondsToHuman(s) if s < 60 then if s > 0 or s < 0 then return string.format('%.1f seconds', s) else return string.format('0 seconds', s) end end local days = math.f...")
(No difference)
432

edits