delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
DKIM-Filter: | OpenDKIM Filter v2.11.0 sourceware.org EC5553945C05 |
DKIM-Signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; |
s=default; t=1623126948; | |
bh=r0scMyJolUnEPuA1So9LWzTS6EoXLTJ2Kdc4tTwm8Qs=; | |
h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: | |
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: | |
From; | |
b=u3rSjJyKp+5PHYyJmYpuPuFy/jctkQZrRQZ54xoWTkPowGbiJTtmLXAcHnt93Y/h4 | |
uCBI1CWvCNsN0AB6rFwee6poT749BeKFoRjwXoMh6EnaDeGWH7jsuOdfdouspI4OwX | |
Wecd+9ru2PKcbt3iHrNjpVI6VHq1wqClDuHSF8xU= | |
X-Original-To: | cygwin AT cygwin DOT com |
Delivered-To: | cygwin AT cygwin DOT com |
DMARC-Filter: | OpenDMARC Filter v1.4.1 sourceware.org BD1EB385743E |
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 AT mail DOT ru> |
In-Reply-To: | <5542c19d-8b1a-1f28-2003-fe9493ee9b56@mail.ru> |
Date: | Mon, 7 Jun 2021 21:34:45 -0700 |
Message-ID: | <CANV2+nXndvbu9_Ey2W8zbC-OdVkV0ZGmo4ZUvHH1fA+wen5PvA@mail.gmail.com> |
Subject: | Re: Python for Windows reports wrong local time when run under Cygwin |
on Europe/Moscow TZ | |
To: | Mike Kaganski <mikekaganski AT mail DOT ru> |
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 | |
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: | Russell VT via Cygwin <cygwin AT cygwin DOT com> |
Reply-To: | Russell VT <russellvt AT gmail DOT com> |
Cc: | cygwin AT cygwin DOT com |
Sender: | "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com> |
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 <cygwin AT cygwin DOT com> 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 AT 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 AT 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 <russellvt AT gmail DOT com> -- 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
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |