lua date和time
now=os.date("*t") --table
for i,v in pairs(now) do
print(i,v)
end
now=os.date("%y-%m-%d %I:%M:%S")
print(now)
now=os.date("%Y-%m-%d %H:%M:%S")
print(now)
sec=os.time() --时间戳
print(sec)
print(os.date("%Y-%m-%d %H:%M:%S", sec))--时间戳转日期
now=os.date("*t") --table
for i,v in pairs(now) do
print(i,v)
end
now=os.date("%y-%m-%d %I:%M:%S")
print(now)
now=os.date("%Y-%m-%d %H:%M:%S")
print(now)
sec=os.time() --时间戳
print(sec)
print(os.date("%Y-%m-%d %H:%M:%S", sec))--时间戳转日期