This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Setting TZ may break time() in non-Cygwin programs


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]