Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I get the current date?

Slightly confused... I've never done something like this.

1 answer

do you even fl3x dood

Months = {
31,
28,
31,
30,
31,
30,
31,
31,
30,
31,
30,
31
}

function Round(d)
return math.floor(d+0.5)
end

Da = Round(tick()/86400)

Year = 1970

function PassYear()
for i,v in ipairs(Months) do
if i == 2 and Year%4 == 0 then
Da = Da-1
end
for j = 1, v do
Da = Da-1
if Da == 0 then
Date = i.."/"..j.."/"..Year
return
end
end
end
Year = Year + 1
PassYear()
end

PassYear()

m = Instance.new("Message",workspace)
m.Text = "Today is "..Date
wait(5)
m:Destroy()

4 comments

0

Wow okay... that's a lot of lines just to get a date... XD

0

just bcuz im happi;-)

0

kthx

0

You really should use indentation, it makes code much easier to read. That's a great script though.

This discussion is preserved as it was. New answers, comments, and votes are closed.