I am trying to make it so if it is Friday there will be special deal's in the shop. I have looked through tons of questions and only found super complex answers. I found on the wiki that when called with a data table it should return a table or something? :P I am new with tables... But anyway it looks like it should be pretty easy to get the month, day, hour, year, etc. As said I am new with table so could someone help explain this?
✓ ANSWER ACCEPTED
How do get the REAL date? It looks simple.
2 answers
✓ Accepted answer
That API refers to passing in dates, not getting them back. Roblox doesn't provide a way to get real dates back out as of right now. (This would be os.date in real Lua.)
Despite this, it's still possible, albeit challenging, to get the real date by mathematical calculation on the Unix epoch.
For a quick answer, you can use the following code which will print the current day (e.g. Friday) using a module written by BlueTaslem.
local Date = require(271818993)
print(Date():format( "Week" )) --> Friday
For further reading, see:
- http://stackoverflow.com/questions/21593692/convert-unix-timestamp-to-date-without-system-libs
- Implementation of the above
- Implementation of mktime (a call used internally in C to generate dates from unix time)
Enable HTTPService and use this:
local hs = game:GetService("HttpService")
local rawdata = hs:GetAsync("https://www.checkiday.com/", true)
if(type(rawdata)=='string') then
-- print(rawdata)
local result= rawdata:match('\<meta name="description" content="(.+)- Today')
print("today is: "..result)
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
Computing day-of-the-week is literally the easier operation and I had a typo in it. I'm not sure how that got past me when I tested. The module is updated to give the correct day-of-week now.
You might also be able to use HttpService and get the date from an API on the Internet.
ok
Thanks so much!!