Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

How do I get the current date?

Asked by
Exudo 13
10 years ago

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

1 answer

Log in to vote
3
Answered by
Vividex 162
10 years ago

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()

0
Wow okay... that's a lot of lines just to get a date... XD Exudo 13 — 10y
0
just bcuz im happi;-) Vividex 162 — 10y
0
kthx Exudo 13 — 10y
0
You really should use indentation, it makes code much easier to read. That's a great script though. gskw 1046 — 10y
Ad

Answer this question