function LuaFnDayTime2DateTime(sceneId,selfId,nDayTime)
--19 168
local nDay = mod(nDayTime,1000)
local nMonth = {31,28,31,30,31,30,31,31,30,31,30,31}
if mod(floor(nDayTime/1000),4) == 0 then --闰年
nMonth[2] = 29
end
local nTempDay = nDay
local nMonthTime = 0
for i = 1,12 do
nTempDay = nTempDay - nMonth[i]
if nTempDay < 0 then
nMonthTime = i
break
end
end
local nTempDay_add = 0
for i = 1,nMonthTime - 1 do
nTempDay_add = nTempDay_add + nMonth[i]
end
nDay = nDay - nTempDay_add + 1
local nEcho = "20"..floor(nDayTime/1000)
if nMonthTime < 10 then
nMonthTime = "0"..nMonthTime
end
nEcho = nEcho..nMonthTime
if nDay < 10 then
nDay = "0"..nDay
end
nEcho = nEcho..nDay
return tonumber(nEcho)
end
|