I am having A problem with my script that gets the current time but I noticed after 2020 there was an error in this time script.
function getcurrectMonth(DoTy, months)
local var2 = DoTy
for i = 1, #months do
if var2 <= months[i] then return i, var2 else var2 = var2 - months[i] end
end
end
function timestamp()
local months = {31, 28, 31, 30, 31, 30, 31,31,30, 31, 30, 31}
local timezone, offset_hours = "GMT", 0
local secondspassed = (script.Parent.Parent.FavoriteTimeValue.Value)+(3600*offset_hours)
local yearspassed = math.floor(secondspassed/31557600)
local YoTc = yearspassed+1970 -- Year of the Century (change the 30 to 130 when it's 2100 :D (if it's 2100....))
local DoTy = math.floor((secondspassed-(yearspassed*(31557600)))/86400)+1
if YoTc/4-math.floor(YoTc/4) == 0 then months[2] = 29 end
local MoTy, DoTm = getcurrectMonth(DoTy, months)
local HR = math.floor((secondspassed-((math.floor(secondspassed/86400))*86400))/3600)
local MIN = math.floor((secondspassed-((math.floor(secondspassed/3600))*3600))/60)
local SEC = math.floor((secondspassed-((math.floor(secondspassed/60))*60)))
if string.len(HR)==1 then HR = "0"..HR end
if string.len(MIN)==1 then MIN = "0"..MIN end
if string.len(SEC)==1 then SEC = "0"..SEC end
return MoTy.."/"..DoTm.."/"..YoTc.." "..HR..":"..MIN..":"..SEC
end
This is the Issue that I’m having in this script

I tried to Print all the values and the Months and Days said “nil” so its a nil value
At 00:00 the script broke and this error had started to occur in this script.
This Script was Working in 2019.