Linuxのタイムスタンプから現在の時間を取得するにはどうすればよいですか? 年、月、日、分、秒は取得できますが、時間は取得できません。何か助けはありますか?
現在のコード:
local secondsPassed = os ~= nil and os.time() or tick()
local year = 1970 + math.floor(secondsPassed / (86400 * 365.25))
local days = math.floor((secondsPassed % (365.25 * 86400)) / 86400)
days = days + (year - 2011)
local minutes = math.floor((secondsPassed % 3600) / 60)
local seconds = math.floor(secondsPassed % 60)
壊れた:
local hours = math.floor((secondsPassed % 86400) / 3600)-- +1