How do you get a date on roblox and add exactly 1 day to it? (Minutes included). Im trying to do it for this trello API that I have, but it isn't working right.
✓ ANSWER ACCEPTED
Help with Trello API?
1 answer
✓ Accepted answer
So I looked around and I found this script someone made: ` local function GetTime(SetTick) local Tick = SetTick or tick() local Months = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31} local TimeBetweenMonths = {31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365} local Year local Month local Day local Hour local Minute local Second
Year = math.floor(1970 + (Tick / 31557600))
if ((Year % 4) == 0) then
Months[2] = 29
for i, v in pairs(TimeBetweenMonths) do
if i ~= 1 then
TimeBetweenMonths[i] = TimeBetweenMonths[i] + 1
end
end
end
Day = math.floor(((Tick / 86400) % 365.25))
for i, v in pairs(Months) do
if (TimeBetweenMonths[i] - Months[i]) < Day then
Month = i
end
end
local Hour = math.floor((Tick % 86400) / 60 / 60)
local Minute = math.floor((((Tick % 86400) / 60 / 60) - Hour) * 60)
local Second = math.floor((Tick % 60))
local CurrentYear = Year
local CurrentMonth = Month
local CurrentDay = (Day - (TimeBetweenMonths[Month] - Months[Month])) + 1
local CurrentHour = Hour
local CurrentMinute = Minute
local CurrentSecond = Second
for i = 0, 9 do
if CurrentMonth == i then
CurrentMonth = "0"..CurrentMonth
end
if CurrentDay == i then
CurrentDay = "0"..CurrentDay
end
if CurrentHour == i then
CurrentHour = "0"..CurrentHour
end
if CurrentMinute == i then
CurrentMinute = "0"..CurrentMinute
end
if CurrentSecond == i then
CurrentSecond = "0"..CurrentSecond
end
end
local DateTime = CurrentYear.."/"..CurrentMonth.."/"..CurrentDay.." and the time is "..CurrentHour..":"..CurrentMinute..":"..CurrentSecond
return DateTime
end
while wait(1) do print(GetTime()) end`
This will return the Year/Month/Day + 1 and then Hour:Minute:Second
Try googling next time.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Hmm, sorry about the format messing up I can't seem to get that working.