我在没有日期支持的lua中工作所以有什么方法可以将unix毫秒时间转换为时间和日期
mm/dd/yyyy hh:mm:ss
我有时间和日期,但年和月很难
谢谢。
编辑:我所需要的只是月份中的某一天,现在我想出了其他部分
编辑:代码的第一部分 NO DAY OF MONTH 并且仍在处理 DST
TIMEZONE=-5
DAYLIGHTSAVING=0--NOT DONE
while true do
t=tick()
y=math.floor(1970+ t /31556926)
ds=((1970+t/31556926)-y)*31556926
m=math.floor(ds/2629743)+1
d=math.floor(ds/86400)+1
md=0--NOT DONE
wd=d%7+6
print(md,wd)
h=math.floor(math.fmod(t,60*60*24)/3600) + 5 + (TIMEZONE) + (DAYLIGHTSAVING)
mn= math.floor(math.fmod(t,60*60*24)/60 - 60*h)
s= math.floor(math.fmod(math.fmod(t,60*60*24),60))
print(m,d,y)
print(h,mn,s)
wait(1)
end
我会在我得到每月的某一天和 DST 后让它变得更好