delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2021/06/08/13:39:14

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AB195397301A
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1623173951;
bh=gGqYQxOQ6xT/00us9Om0x0PCT5600n8SDwE0FNaAmcI=;
h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post:
List-Help:List-Subscribe:From:Reply-To:Cc:From;
b=KR8Z8F4slpGjAxevyTeyjBylEWv4YoULzIeH+0GRRg0iH/AlR4Svu5Kg+HSbdwlsT
h9fA/u/OKWyUM2KT2YyXj15jSTAcJyhWTeMY6nPDoMVvg69jriW8L+KdRAGJBRKVuq
OucI4QfUVkJpCtp8vDKpaFnOhxPZmV8iF0pKo6bI=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EA48D397282A
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc;
bh=D8/neJWMqgrjDF30N2xu0sV3MHLlhEGModYsoEbqZHs=;
b=gW3dATHtVJJ6OfD6cy1pgQbxXYoySI/c88DOJpRTYwqSygJHewJCdVPhBPpBENI3JZ
MNtUiJan+oCjLK73ceOtisz74SkZHOdFPFAPX23Da/z4AaRI2+e4l1ODSfa4AxaFlblW
MeR9J/Ln5/mvgZ+FVEQzZ7R2lgcirGjLHhRKBVKvWKNWa9ZuYxecDkMNrS+waYOlEw8c
+VWBZ+tmjI5wVrtLJvf4QS/hZHDWa8INrS+gfWEPrQhd79CrCthfBYJOOG9umzjWbxFJ
9sxissdm/IhGk67f5gHhzLUR5FeGWoppw/E9INjgjVc1fa7ziNeCSj3IXZv535gCSGoO
OWIA==
X-Gm-Message-State: AOAM532DB+wydehXhL1Z1ZMp9PfuB/1k/z2BPWtF8Q0lcBbrYGtqTcwM
W7UODISx05/waTX7Emjztv6nUW9yrcj5dToU4nJMODl2x8NU/A==
X-Google-Smtp-Source: ABdhPJxbK7xsm07qrV3hF6uRS+N3WLelrZNiwMk7XjJlR5pd3ysrUXxKn+bZOv2wd8A9Omw7GjZxSKBJkZGAQrWyQsI=
X-Received: by 2002:a05:6402:cb1:: with SMTP id
cn17mr27026085edb.42.1623173868804;
Tue, 08 Jun 2021 10:37:48 -0700 (PDT)
MIME-Version: 1.0
Date: Tue, 8 Jun 2021 10:37:37 -0700
Message-ID: <CAAHpriO6A+6bLXt0Qe-xpdXT1CiLjk7=7G31cHBtnVJ0kXb2Eg@mail.gmail.com>
Subject: Re: Python for Windows reports wrong local time when run under Cygwin
on Europe/Moscow TZ
To: cygwin AT cygwin DOT com
X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE,
RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS,
TXREP autolearn=ham autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
server2.sourceware.org
X-Content-Filtered-By: Mailman/MimeDel 2.1.29
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Keith Thompson via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Keith Thompson <Keith DOT S DOT Thompson AT gmail DOT com>
Cc: Keith Thompson <Keith DOT S DOT Thompson AT gmail DOT com>
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

There is a known problem with the $TZ environment variable.

Here's a discussion from 2017:
https://cygwin.com/pipermail/cygwin/2017-May/232675.html

The problem is that both Cygwin and Windows use the $TZ environment
variable, but they interpret it differently.

The Windows handling of $TZ (or %TZ%) is documented here:
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/tzset?view=msvc-160

For example, Pacific Time is represented as TZ=PST8PDT.

In Cygwin, my $TZ is set by default to "America/Los_Angeles".
Any Windows applications that I invoke from Cygwin, if they attempt
to determine the time zone, will behave inconsistently because they
don't see "America/Los_Angeles" as a valid time zone string.

I've worked around this by unsetting TZ in my .bash_profile .
Cygwin applications are still able to determine the correct time zone.

I suggest that Cygwin should *not* set the TZ environment variable.

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019