Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local v = "January/31/2025"
- local weekD = {
- [0] = "Saturday",
- [1] = "Sunday",
- [2] = "Monday",
- [3] = "Tuesday",
- [4] = "Wednesday",
- [5] = "Thursday",
- [6] = "Friday"
- }
- local months = {
- ["March"] = 3,
- ["April"] = 4,
- ["May"] = 5,
- ["June"] = 6,
- ["July"] = 7,
- ["August"] = 8,
- ["September"] = 9,
- ["October"] = 10,
- ["November"] = 11,
- ["December"] = 12,
- ["January"] = 13,
- ["February"] = 14
- }
- local split = string.split(v, "/")
- local y = split[3]
- if split[1] == "January" or split[1] == "February" then
- y = y - 1
- end
- local q = tonumber(split[2])
- local m = tonumber(months[split[1]])
- local k = tonumber(y)%100
- local j = tonumber(y)//100
- h = weekD[(q+math.floor((13*(m+1))/5)+k+math.floor(k/4)+math.floor(j/4)+5*j)%7]
- print(split[1] .. " " .. split[2] .. ", " .. split[3] .. " is on a " .. h) -- day of the week output
Advertisement
Add Comment
Please, Sign In to add comment