X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-1.7 required=5.0	tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY
X-Spam-Check-By: sourceware.org
Message-ID: <4F57B610.5030702@t-online.de>
Date: Wed, 07 Mar 2012 20:25:04 +0100
From: Christian Franke <Christian.Franke@t-online.de>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20120216 Firefox/10.0.2 SeaMonkey/2.7.2
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: Setting TZ may break time() in non-Cygwin programs
References: <4F4FD8C6.5000807@t-online.de> <20120302091317.GD14404@calimero.vinschen.de> <4F513D11.2080203@t-online.de> <20120304115232.GC18852@calimero.vinschen.de> <4F53B791.2090709@t-online.de> <20120304204938.GL18852@calimero.vinschen.de>
In-Reply-To: <20120304204938.GL18852@calimero.vinschen.de>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Corinna Vinschen wrote:
> On Mar  4 19:42, Christian Franke wrote:
>> Corinna Vinschen wrote:
>>> On Mar  2 22:35, Christian Franke wrote:
>>>> Corinna Vinschen wrote:
>>>>> But, as usual, PTC.
>>>> OK, ...
>>>>
>>>>> Simple: Unset TZ for Win32 programs run from Cygwin.
>>>>>
>>>>> More flexible: Set (unset) TZ=CYGWIN_WINENV_TZ if this variable is
>>>>> set (to empty). Otherwise keep TZ as is.
>>>>>
>>>> would a patch for any of the above have a chance to get accepted?
>>> If it's not getting too complicated, yes.  However, the second idea
>>> I don't understand.  Can you explain this differently?
>>>
>> Let another variable change the value passed to Windows environment:
>>
>> $ printenv TZ
>> Europe/Berlin
>>
>> $ cmd /c echo %TZ%
>> Europe/Berlin
>>
>> $ export CYGWIN_WINENV_TZ=CET-1CEST
>>
>> $ printenv TZ
>> Europe/Berlin
>>
>> $ cmd /c echo %TZ%
>> CET-1CEST
>>
>> $ export CYGWIN_WINENV_TZ=
>>
>> $ cmd /c echo %TZ%
>> %TZ% (which means TZ is not set)
> Hmm.  I think just unsetting TZ should be sufficient.  MSVCRT uses the
> current timezone as default anyway, doesn't it?
>

Yes. I will post a patch soon.

Christian


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

