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

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

Asked by 7 years ago
Edited 7 years ago

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?

0
print your output wookey12 174 — 7y

1 answer

Log in to vote
0
Answered by
cabbler 1942 Moderation Voter
7 years ago

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
Ad

Answer this question