传入一个时间,单位秒,显示为时间格式,例如"09:10:45"
function setTime(self, l_time)
if l_time == nil or l_time <= 0 then
return "0:00:00"
end
l_time = math.ceil(l_time)
local l_hour = math.floor(l_time / 3600)
local l_left = l_time - l_hour * 3600
local l_min = math.floor(l_left / 60)
local l_sec = l_left - l_min * 60
if l_sec == nil then
l_sec = 0
end
local l_minstr = math.ceil(l_min)
local l_secstr = math.ceil(l_sec)
if l_min < 10 then
l_minstr = "0"..l_minstr
end
if l_sec < 10 then
l_secstr = "0"..l_secstr
end
return l_hour..":"..l_minstr..":"..l_secstr
end