Re: zoneinfo problem

From: Greg 'groggy' Lehey <grog_at_FreeBSD.org>
Date: Sat, 04 Dec 2021 22:03:27 UTC
On Saturday,  4 December 2021 at  3:58:24 -0500, Derek Schrock wrote:
> On Sat, Dec 04, 2021 at 01:59:10AM EST, Özkan KIRIK wrote:
>> # ln -s /usr/share/zoneinfo/Etc/GMT+3 /etc/localtime
>> # date
>> Sat Dec  4 03:48:50 -03 2021
>>
>> Above, I want to set the timezone to GMT+3 but date command shows as GMT-3
>
> This is expected.
>
> https://github.com/eggert/tz/blob/2018g/etcetera#L38-L44

To quote that page, which is also in the sources as
/usr/src/contrib/tzdata/etcetera:

  # Be consistent with POSIX TZ settings in the Zone names,
  # even though this is the opposite of what many people expect.
  # POSIX has positive signs west of Greenwich, but many people expect
  # positive signs east of Greenwich.  For example, TZ='Etc/GMT+4' uses
  # the abbreviation "-04" and corresponds to 4 hours behind UT
  # (i.e. west of Greenwich) even though many people would expect it to
  # mean 4 hours ahead of UT (i.e. east of Greenwich).

I'd be more inclined to say "this is intentional" rather than "this is
expected".  I certainly didn't expect it.  It's clearly a carry-over
from the old System V nonsense that made its way into POSIX.  All the
more reason to avoid the "GMT" offsets (GMT is no longer used in time
zone calculations).

Thanks for pointing this out.

Greg
--
Sent from my desktop computer.
See complete headers for address and phone numbers.
This message is digitally signed.  If your Microsoft mail program
reports problems, please read http://lemis.com/broken-MUA.php