From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) by sourceware.org (Postfix) with ESMTPS id BD1EB385743E for ; Tue, 8 Jun 2021 04:35:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BD1EB385743E Received: by mail-oi1-x232.google.com with SMTP id r17so10105650oic.7 for ; Mon, 07 Jun 2021 21:35:01 -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:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EFJDFzp9tHPeaOC/2VrQ0GcHK9cv8V9QWTJwrkSFUE4=; b=oeYp2aj6tx40bDUxAdrWdN0H6zeMBYrmGJK9QGiWV6fq/XRLHvOapJWOf6h1HFtnrb qPIJ514mLs9HMImfk1JNcCf4Cexm+AM1dUD4ECzg6NkY7Y384G1U9d66s3kV5fjfX5xE 57dDoXhiAljK50qZ9OPWv+mGHHAlN8m0Rx8ctHAHLDzItCPJaaC0fqtlYpO0CQg5u6cU Az+br3ngcVSugLf9P16MP4//CyE/Ch9V1TcLO/MG0wNI4C+Tqn0vgZtpN9Xtufj2Zr+Z SLWGQrQZuW7JmHkINmgWYt9n8LsvY7Gw8KBhcxV6lSqX4gD6m07PlQSQgjk+YaWOd6ZE RfjQ== X-Gm-Message-State: AOAM532CYlKZhVqnRDZ8z80WzdVGOulK4QXRI6b7PIkYtM5QmRDX6kdI FdqbMu2u9WaraBNXOyPZ5Qqsd79CFT97rrlVV3c= X-Google-Smtp-Source: ABdhPJyI/U7eNHUvB4jMFQkyOOB9D+PWLNLwFxyVP5xW7p5QrfUF++lwYh8nP8iz76QwslQQmOPRc2H4Yj7mRC66VcI= X-Received: by 2002:a54:4784:: with SMTP id o4mr1567587oic.52.1623126901145; Mon, 07 Jun 2021 21:35:01 -0700 (PDT) MIME-Version: 1.0 References: <5542c19d-8b1a-1f28-2003-fe9493ee9b56@mail.ru> In-Reply-To: <5542c19d-8b1a-1f28-2003-fe9493ee9b56@mail.ru> From: Russell VT Date: Mon, 7 Jun 2021 21:34:45 -0700 Message-ID: Subject: Re: Python for Windows reports wrong local time when run under Cygwin on Europe/Moscow TZ To: Mike Kaganski Cc: cygwin@cygwin.com X-Spam-Status: No, score=-1.5 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 04:35:12 -0000 What version(s) of the timezone files are installed on each? Also, seems one of the Python versions came from Windows, rather than Cygwin? On Mon, Jun 7, 2021 at 12:01 AM Mike Kaganski via Cygwin wrote: > Hello, > > Running Cygwin 3.1.7-1 on Windows 10 Version 21H1 (OS Build 19043.985), > I have this issue: > > when I start Cygwin's Python, I have correct time reported: > > > mikek@DESKTOP-8SHAE9Q ~ > > $ python > > Python 3.8.9 (default, Apr 21 2021, 23:14:29) > > [GCC 10.2.0] on cygwin > > Type "help", "copyright", "credits" or "license" for more information. > > >>> import datetime > > >>> datetime.datetime.now() > > datetime.datetime(2021, 6, 7, 9, 40, 15, 318391) > > But running Python for Windows (it doesn't matter which, specifically > for the test I used the one from MS Store [1]), I have incorrect local > time: > > > mikek@DESKTOP-8SHAE9Q ~ > > $ "C:/Program > > > Files/WindowsApps/PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64__qbz5n2kfra8p0/python3.8.exe" > > Python 3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:48:03) [MSC > > v.1928 64 bit (AMD64)] on win32 > > Type "help", "copyright", "credits" or "license" for more information. > > >>> import datetime > > >>> datetime.datetime.now() > > datetime.datetime(2021, 6, 7, 7, 40, 55, 503775) > > Note how the latter output reports 2021-06-07 07:40, while the former > reports 2021-06-07 09:40. The difference is 2 hours. > > Starting the same Python for Windows from cmd.exe has it correct: > > > C:\Users\mikek>python > > Python 3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:48:03) [MSC > > v.1928 64 bit (AMD64)] on win32 > > Type "help", "copyright", "credits" or "license" for more information. > > >>> import datetime > > >>> datetime.datetime.now() > > datetime.datetime(2021, 6, 7, 9, 41, 21, 925240) > > Cygwin reports correct timezone: > > > $ echo $TZ > > Europe/Moscow > > Starting Python for Windows using a different timezone (specifically, '$ > TZ=UTC "C:/Program > Files/WindowsApps/PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64__qbz5n2kfra8p0/python3.8.exe"') > > gives correct time for *that* time zone. > > This is a problem, because in our project (LibreOffice), we use Cygwin > as environment for unit testing, where LibreOffice's own Python (also > built natively for Windows) is used, and at some times (from 00:00 till > 02:00) it reports wrong dates, which makes tests fail locally on > affected systems(see [2]). > > Thank you! > > > [1] https://www.microsoft.com/en-us/p/python-38/9mssztt1n39l > > [2] > > https://gerrit.libreoffice.org/c/core/+/92217/2#message-f55091795e7cde9d75adc00ddb69451121b644f6 > > > -- > > Best regards, > > Mike Kaganski > > > -- > 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 > -- Russell M. Van Tassell