[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: lua how to get current and previous day
- From: Martin Schröder <martin@...>
- Date: Tue, 14 Sep 2010 21:34:44 +0200
2010/9/14 Natanael Copa <firstname.lastname@example.org>:
> On Tue, Sep 14, 2010 at 3:10 PM, Ted Unangst <email@example.com> wrote:
>> Option 1:
>> now = os.time()
>> yesterday = now - 3600*24
>> print(os.date("...", yesterday))
> This might give you weird bugs once in a while as it wrongly assumes
> that a day is always 3600 * 24 hours. You need take leap years and
> leap seconds in consideration.
And what happens at tz conversions (summer time <-> winter time)?