I made this function earlier this month, and with the turning of the month, I have been experimenting with the function to see how it would handle, for some reason I am getting September of 2016 and I have no clue as to how it is getting that. I know this script is inefficient, but I saw no other way of doing it since some previously made scripts have outputted "0-11-14" or sometime in May. I am not huge on hard math, but I thought this way would be easy enough for me. Any help would be appreciated, thank you.
function GetDate()
local begin = 1412035200
local dayssince = math.floor(((math.floor(os.time()) - begin)+86400) / 86400) --The +86400 is for testing purposes, feel free to remove it.
print(dayssince)
local datetoday = ""
local monthsandyears = {["October 2014"] = 31; ["November 2014"] = 30; ["December 2014"] = 31;
["January 2015"] = 31; ["Febuary 2015"] = 28; ["March 2015"] = 31; ["April 2015"] = 30; ["May 2015"] = 31; ["June 2015"] = 30; ["July 2015"] = 31; ["August 2015"] = 31; ["Spetember 2015"] = 30; ["October 2015"] = 31; ["November 2015"] = 30; ["December 2015"] = 31;
["January 2016"] = 31; ["Febuary 2016"] = 29; ["March 2016"] = 31; ["April 2016"] = 30; ["May 2016"] = 31; ["June 2016"] = 30; ["July 2016"] = 31; ["August 2016"] = 31; ["Spetember 2016"] = 30; ["October 2016"] = 31; ["November 2016"] = 30; ["December 2016"] = 31;
["January 2017"] = 31; ["Febuary 2017"] = 28; ["March 2017"] = 31; ["April 2017"] = 30; ["May 2017"] = 31; ["June 2017"] = 30; ["July 2017"] = 31; ["August 2017"] = 31; ["Spetember 2017"] = 30; ["October 2017"] = 31; ["November 2017"] = 30; ["December 2017"] = 31;
["January 2018"] = 31; ["Febuary 2018"] = 28; ["March 2018"] = 31; ["April 2018"] = 30; ["May 2018"] = 31; ["June 2018"] = 30; ["July 2018"] = 31; ["August 2018"] = 31; ["Spetember 2018"] = 30; ["October 2018"] = 31; ["November 2018"] = 30; ["December 2018"] = 31;
["January 2019"] = 31; ["Febuary 2019"] = 28; ["March 2019"] = 31; ["April 2019"] = 30; ["May 2019"] = 31; ["June 2019"] = 30; ["July 2019"] = 31; ["August 2019"] = 31; ["Spetember 2019"] = 30; ["October 2019"] = 31; ["November 2019"] = 30; ["December 2019"] = 31;
["January 2020"] = 31; ["Febuary 2020"] = 29; ["March 2020"] = 31; ["April 2020"] = 30; ["May 2020"] = 31; ["June 2020"] = 30; ["July 2020"] = 31; ["August 2020"] = 31; ["Spetember 2020"] = 30; ["October 2020"] = 31; ["November 2020"] = 30; ["December 2020"] = 31;
}
local month = ""
for i,v in pairs(monthsandyears) do
if v < dayssince then
dayssince = dayssince - v
else
month = i
end
end
if dayssince == 0 then dayssince = 1 end
datetoday = dayssince .. " " .. month
return datetoday
end

2 comments
Alright, thank you for fixing up the script, but I think I might experiment with os.time, I just looked up a Lua article and I think it might help me ( http://www.lua.org/pil/22.1.html )
EUREKA! I GOT A WORKING SCRIPT WOOHOO!!! IT IS NOT MESSING UP ON THE DATE! Contact me if you want a copy for others whom may be concerned by this topic. I really think Roblox should add os.date() to their Lua book though.