[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lua how to get current and previous day
- From: Ted Unangst <ted.unangst@...>
- Date: Tue, 14 Sep 2010 09:10:04 -0400
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)
...