[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Back and forth UTC dates
- From: Francisco Olarte <folarte@...>
- Date: Tue, 28 Mar 2017 13:43:15 +0200
On Tue, Mar 28, 2017 at 1:34 PM, Oliver Kroth <oliver.kroth@nec-i.de> wrote:
> os.time() normally operates on local time. I usually apply a correction:
> utc = os.time{ ...some table ...} - os.time{year=1970, month=1, day=1,
> hour=0}
> which subtracts the offset to local time.
Doesn't this have a problem with DST? In my system, TZ=Europe/Madrid:
> now=os.time()
> os.date("%c", now)
Tue Mar 28 13:22:36 2017
> os.date("!%c", now)
Tue Mar 28 11:22:36 2017
> os.time{year=1970, month=1, day=1, hour=0}
-3600
> os.date("%Z", now)
CEST
( Central Europe daylight Saving Time )
And remember timezones evolve with time.
Francisco Olarte.