[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: os.time() and timezones
- From: steve donovan <steve.j.donovan@...>
- Date: Fri, 13 Apr 2012 10:23:11 +0200
On Fri, Apr 13, 2012 at 10:16 AM, Rena <hyperhacker@gmail.com> wrote:
> Ouch.) Does Lua provide a way to turn a table into a Unix timestamp
> under the assumption that the table specifies GMT, not the local
> timezone?
I use this kind of logic to find the timezone offset in pl.Date:
local t = os.time()
local ut = os.date('!*t',t)
local lt = os.date('*t',t)
thour = lt.hour - ut.hour
tmin = lt.min - ut.min
If this is misguided I would certainly like to know!
steve d.