On Thursday, May 19, 2005 at 3:24:39 PM +0200, Hrvoje Niksic wrote:
> * Is "GMT0" a portable value for TZ?
TZ=GMT0 works on Linux libc5/Glibc, Cygwin, and MinGW.
> setenv is not available on Windows, or at least Borland's headers
> don't include a prototype. (But they do include putenv.)
(un)setenv are not available in MinGW, but exist in Cygwin. Putenv is
available on both.
Additional problem with putenv(): To remove TZ Linux and Cygwin need
putenv("TZ"), while MinGW wants putenv("TZ=") with equal.
> I really don't understand how setting TZ to an empty string makes it
> point to UTC.
Not portable: TZ="" works more or less as GMT0 on Linux and Cygwin, but
not on MinGW where it behaves as with unset TZ, taking system timezone
from control panel.
MinGW just uses Windows libc equivalent dll, so behaviour may be the
same with other compilers.
Alain.