lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Tue, Sep 14, 2010 at 5:30 AM, soly man <luascript2010@gmail.com> wrote:
> Dear friends
>
> I have  the following lua code and i want to get the current day and
> the previous day

Option 1:
now = os.time()
yesterday = now - 3600*24
print(os.date("...", yesterday))

Option 2:
t = os.date("*t")
t.day = t.day - 1
yesterday = os.time(t)
...