How to get the current year, month, day, hour, min and sec in Lua

1 Answer

0 votes
local dt = os.date("*t")

local d = string.format("%d-%d-%d %d:%d:%d", dt.year, dt.month, dt.wday, dt.hour, dt.min, dt.sec)

print(d)



--[[
run:
  
2020-9-6 7:9:17
 
--]]

 



answered Sep 25, 2020 by avibootz
edited Sep 25, 2020 by avibootz
...