From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by sourceware.org (Postfix) with ESMTPS id EA48D397282A for ; Tue, 8 Jun 2021 17:37:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EA48D397282A Received: by mail-ed1-x52e.google.com with SMTP id f5so20481397eds.0 for ; Tue, 08 Jun 2021 10:37:49 -0700 (PDT) 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 From: Keith Thompson Date: Tue, 8 Jun 2021 10:37:37 -0700 Message-ID: Subject: Re: Python for Windows reports wrong local time when run under Cygwin on Europe/Moscow TZ To: cygwin@cygwin.com Cc: Keith Thompson 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 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 17:38:00 -0000 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.