1、時間戳轉換成時間
local t = 1412753621000
function getTimeStamp(t)
return
os.date(
"%Y%m%d%H"
,t/1000)
end
print(getTimeStamp(t))
2、得時間戳
os.time() -- 當前時間戳
os.time({day=17, month=5, year=2012, hour=0, minute=0, second=0}) -- 指定時間的時間戳
3、時間格式 yyyyMMddHHmmss
print(os.date("%Y%m%d%H%M%S", os.time()))