ERROR:field 'day' missing in date table

761 views
Skip to first unread message

cellist

unread,
Sep 10, 2011, 4:08:05 AM9/10/11
to luaforwindows
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\Owner>"C:\Program Files (x86)\Lua\5.1\lua.exe" -lilua
ILUA: Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
"quit" to end
> z=os.time({2011,9,10,3,20,16})
[string "local"]:1: field 'day' missing in date table

The os.time doc says that "This table must have fields year, month,
and day, and may have fields hour, min, sec, and isdst (for a
description of these fields, see the os.date function)."

Any idea how I can get this to work?
TIA,
Phil

Ryan Pusztai

unread,
Sep 10, 2011, 2:11:06 PM9/10/11
to luafor...@googlegroups.com

Specific questions should be asked on the Lua mailing list (http://www.lua.org/lua-l.html). Lua for Windows is just a distribution of Lua, so you wont get your questions answered as well/fast.
--
Regards,
Ryan

Sent from Android

Andrew Wilson

unread,
Sep 10, 2011, 2:40:31 PM9/10/11
to luafor...@googlegroups.com, pwric...@gmail.com
Phil, here is quick answer...

z=os.time({year=2011,month=9,day=10,hour=3,min=20,sec=16})
print(z)

note : year,month,day,hour,min,sec are all indexes in table.


There is a fair bit about lua programming out there on the web so google it first but Ryan is correct, best place for answers is lua mailing list.

Cheers
Andrew Wilson

Phillip Richcreek

unread,
Sep 10, 2011, 6:44:11 PM9/10/11
to Andrew Wilson, luafor...@googlegroups.com
OK, I get it. First exposure to Lua tables and the terminology. Thanks, Phil.
Reply all
Reply to author
Forward
0 new messages