delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/03/04/15:50:23

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Sun, 4 Mar 2012 21:49:38 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Setting TZ may break time() in non-Cygwin programs
Message-ID: <20120304204938.GL18852@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <4F4FD8C6 DOT 5000807 AT t-online DOT de> <20120302091317 DOT GD14404 AT calimero DOT vinschen DOT de> <4F513D11 DOT 2080203 AT t-online DOT de> <20120304115232 DOT GC18852 AT calimero DOT vinschen DOT de> <4F53B791 DOT 2090709 AT t-online DOT de>
MIME-Version: 1.0
In-Reply-To: <4F53B791.2090709@t-online.de>
User-Agent: Mutt/1.5.21 (2010-09-15)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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?


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
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

- Raw text -


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