Re: tzset: add native Windows workaround

2017-05-09 Thread Bruno Haible
Ken Brown wrote: > ... Here's what I see on my Cygwin system: > > $ echo $TZ > America/New_York > > $ date +'%Y-%m-%d %H:%M:%S %z (%Z)' > 2017-05-03 07:29:03 -0400 (EDT) > > $ TZ= date +'%Y-%m-%d %H:%M:%S %z (%Z)' > 2017-05-03 11:29:14 + (GMT) > > $ unset TZ > > $ date +'%Y-%m-%d %H:%M:%S

Re: tzset: add native Windows workaround

2017-05-09 Thread Bruno Haible
Hi Paul, > > Only for Cygwin, an empty or absent TZ environment variable means GMT. > > That's weird; I don't know of any other system that does that. Misunderstanding: I meant only among the platforms on Windows. I.e. for mingw and MSVC, an empty or absent TZ environment variable means the sys

Re: tzset: add native Windows workaround

2017-05-04 Thread Eli Zaretskii
> From: Bruno Haible > Cc: bug-gnulib@gnu.org > Date: Tue, 02 May 2017 22:19:16 +0200 > > > Also, the test "strchr (tz, '/') != NULL" allows many Cygwin-compatible > > TZ settings that Microsoft does not document support for, e.g., > > TZ="PST8PDT,M3.2.0,M11.1.0" for Los Angeles. Admittedly mos

Re: tzset: add native Windows workaround

2017-05-03 Thread Ken Brown
On 5/3/2017 11:24 AM, Paul Eggert wrote: On 05/03/2017 04:31 AM, Ken Brown wrote: Perhaps the Cygwin folks could be talked into changing an unset TZ to mean "ask the Windows Control Panel". This seems to already be happening. Here's what I see on my Cygwin system: $ echo $TZ America/New_York

Re: tzset: add native Windows workaround

2017-05-03 Thread Marco Atzeri
On 03/05/2017 17:24, Paul Eggert wrote: On 05/03/2017 04:31 AM, Ken Brown wrote: Perhaps the Cygwin folks could be talked into changing an unset TZ to mean "ask the Windows Control Panel". This seems to already be happening. Here's what I see on my Cygwin system: $ echo $TZ America/New_York

Re: tzset: add native Windows workaround

2017-05-03 Thread Paul Eggert
On 05/03/2017 04:31 AM, Ken Brown wrote: Perhaps the Cygwin folks could be talked into changing an unset TZ to mean "ask the Windows Control Panel". This seems to already be happening. Here's what I see on my Cygwin system: $ echo $TZ America/New_York $ date +'%Y-%m-%d %H:%M:%S %z (%Z)' 20

Re: tzset: add native Windows workaround

2017-05-03 Thread Ken Brown
On 5/3/2017 1:18 AM, Paul Eggert wrote: Bruno Haible wrote: Only for Cygwin, an empty or absent TZ environment variable means GMT. That's weird; I don't know of any other system that does that. In many systems, an empty but set TZ means UTC0 without leap seconds; but an unset TZ typically m

Re: tzset: add native Windows workaround

2017-05-02 Thread Paul Eggert
Bruno Haible wrote: Only for Cygwin, an empty or absent TZ environment variable means GMT. That's weird; I don't know of any other system that does that. In many systems, an empty but set TZ means UTC0 without leap seconds; but an unset TZ typically means "ask the file system for the time zo

Re: tzset: add native Windows workaround

2017-05-02 Thread Bruno Haible
Hi Paul, > On 05/01/2017 09:40 AM, Bruno Haible wrote: > > + /* If the environment variable TZ has been set by Cygwin, neutralize it. > > + The Microsoft CRT interprets TZ differently than Cygwin and produces > > + incorrect results if TZ has the syntax used by Cygwin. */ > > + const ch

Re: tzset: add native Windows workaround

2017-05-02 Thread Paul Eggert
On 05/01/2017 09:40 AM, Bruno Haible wrote: + /* If the environment variable TZ has been set by Cygwin, neutralize it. + The Microsoft CRT interprets TZ differently than Cygwin and produces + incorrect results if TZ has the syntax used by Cygwin. */ + const char *tz = getenv ("TZ"); +

tzset: add native Windows workaround

2017-05-01 Thread Bruno Haible
> * Some which should obey TZ, just that they should ignore the values set by > Cygwin (instead of exhibiting garbage behaviour): > > _tzset > https://msdn.microsoft.com/en-us/library/aa273389.aspx > https://msdn.microsoft.com/en-us/library/90s5c885.aspx > http://pubs.opengroup.org/onlin