Adding a time stamp to a discord webhook

Hey there,
I am making a roblox to discord webhook when somebody joins the game and I really wanna add a timestamp at the bottom but I’m not sure how to do that, Anybody know?

1 Like

You could include tick() which is the number of seconds since jan 1st, 1970. Putting this into a calculator can tell you the exact time to the milisecond the webhook was sent.

how would I put that into the calculator to make it say “Today at: (the time)”

This little snippet will give you the time in the format discord is expecting:

local t = os.date("!*t")
local s = {}
for k, v in pairs(t) do
  local temp = tostring(v)
  if #temp == 1 then temp = "0" .. temp end
  s[k] = temp
end
print(s.year .. "-" .. s.month .. "-" .. s.day  .. "T" .. s.hour .. ":" .. s.min .. ":" .. s.sec .. "." .. "000Z")

It isn’t down to the millisecond, but it’s not too important. It’s also in utc+0 which is what discord expects and will use the os of the local user’s computer when they see it.

Thank you so much ill try it out

1 Like