I want to check if its a few days before and a few days after a holiday like christmas or halloween. How can I do this with os.date?
I did it with the assistant! I’ll try figuring out how it works.
Edited code:
local year = os.date("*t").year
local a = year % 19
local b = math.floor(year / 100)
local c = year % 100
local d = math.floor(b / 4)
local e = b % 4
local f = math.floor((b + 8) / 25)
local g = math.floor((b - f + 1) / 3)
local h = (19 * a + b - d - g + 15) % 30
local i = math.floor(c / 4)
local k = c % 4
local l = (32 + 2 * e + 2 * i - h - k) % 7
local m = math.floor((a + 11 * h + 22 * l) / 451)
local month = math.floor((h + l - 7 * m + 114) / 31)
local day = ((h + l - 7 * m + 114) % 31) + 1
local today = os.date("*t")
if today.month == month and today.day > day - 3 and today.day < day + 3 then
--is easter!
else
--is not easter!
end
may i know what assistant you use? chatgpt v-0.1?
I think it’s the built in one.
The roblox assistant. 92834928347iushkjfwd
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.