本文共 783 字,大约阅读时间需要 2 分钟。
1、
把时间 秒,转化为xx天xx时xx分xx秒 的形式
--把时间 秒,转化为xx天xx时xx分xx秒 的形式function convertTimeForm(second) local timeDay = math.floor(second/86400) local timeHour = math.fmod(math.floor(second/3600), 24) local timeMinute = math.fmod(math.floor(second/60), 60) local timeSecond = math.fmod(second, 60) return timeDay, timeHour, timeMinute, timeSecondend2、
把时间 秒,转化为xx时xx分xx秒 的形式
local function formatTime(time) local hour = math.floor(time/3600); local minute = math.fmod(math.floor(time/60), 60) local second = math.fmod(time, 60) local rtTime = string.format("%s:%s:%s", hour, minute, second) return rtTimeend3、
--把1990.1.1至今的秒数,转化为年月日,时分--endTime 单位毫秒os.date("%Y-%m-%d %H:%M",math.floor(endTime/1000))
转载地址:http://emsmi.baihongyu.com/