scriptingtales

Day of the week output (ROBLOX EXCLUSIVE)

Aug 3rd, 2025
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.85 KB | None | 0 0
  1. local v = "January/31/2025"
  2.  
  3. local weekD = {
  4.     [0] = "Saturday",
  5.     [1] = "Sunday",
  6.     [2] = "Monday",
  7.     [3] = "Tuesday",
  8.     [4] = "Wednesday",
  9.     [5] = "Thursday",
  10.     [6] = "Friday"
  11. }
  12.  
  13. local months = {
  14.     ["March"] = 3,
  15.     ["April"] = 4,
  16.     ["May"] = 5,
  17.     ["June"] = 6,
  18.     ["July"] = 7,
  19.     ["August"] = 8,
  20.     ["September"] = 9,
  21.     ["October"] = 10,
  22.     ["November"] = 11,
  23.     ["December"] = 12,
  24.     ["January"] = 13,
  25.     ["February"] = 14
  26. }
  27.  
  28. local split = string.split(v, "/")
  29.  
  30. local y = split[3]
  31.  
  32. if split[1] == "January" or split[1] == "February" then
  33.     y = y - 1
  34. end
  35.  
  36. local q = tonumber(split[2])
  37. local m = tonumber(months[split[1]])
  38. local k = tonumber(y)%100
  39. local j = tonumber(y)//100
  40.  
  41. h = weekD[(q+math.floor((13*(m+1))/5)+k+math.floor(k/4)+math.floor(j/4)+5*j)%7]
  42.  
  43. 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