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

Why is it still saying that I'm missing "day" field?

I'm trying to use os.time for my game, but it keeps saying that I'm missing the "day" field in the date table.

local year = 2018
local month = 12
local day = 23

local date = {year, month, day}

while true do
	print(os.time(date))
	wait(1)
end

I was pretty sure I included the "day" value in it, but it's saying that it's missing. Does anyone know how to get this to work?

1 comment

0

print your output

1 answer

I had to look here. Looks like the table is meant to be a dictionary like {year=x,month=x,day=x}. So this should work...

local year = 2018
local month = 12
local day = 23

local date = {year=year, month=month, day=day}

while true do
    print(os.time(date))
    wait(1)
end

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