[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: new user
- From: Sean Conner <sean@...>
- Date: Tue, 10 Jun 2014 17:31:00 -0400
It was thus said that the Great Levente Kovacs once stated:
> Hello List,
>
>
> I am a new Lua user, so please forgive my ignorance.
>
> I have a few question:
>
> 1. I would like to know how to push multiple variables on the stack (from
> Lua).
In Lua it's:
function foo()
return 1,2,3
end
x,y,z = foo()
print(x,y,z)
> 2. Can I access unix time in Lua? Can I use the same functions like
> gettimeofday(), localtime_r() calls? Or does it have different calls for
> time?
From Lua, os.time() returns the current time, as it's a wrapper around the
standard C library function time(). You use os.date() to convert the time
to a string.
-spc