From: Paul Eggert Date: Tue, 2 May 2017 01:00:56 +0000 (-0700) Subject: tzset: update doc for TZ problems on MS-Windows X-Git-Tag: v1.0~6208 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=b0ebe1b9a51cebdf26e15b86f5c3a408724f1cb0;p=gnulib.git tzset: update doc for TZ problems on MS-Windows * doc/posix-functions/ctime.texi, doc/posix-functions/daylight.texi: * doc/posix-functions/localtime.texi, doc/posix-functions/mktime.texi: * doc/posix-functions/strftime.texi, doc/posix-functions/timezone.texi: * doc/posix-functions/tzname.texi, doc/posix-functions/tzset.texi: * doc/posix-functions/wcsftime.texi: Mention some issues with TZ under MS-Windows. --- diff --git a/ChangeLog b/ChangeLog index c9b61469fb..ad44003ead 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2017-05-01 Paul Eggert + + tzset: update doc for TZ problems on MS-Windows + * doc/posix-functions/ctime.texi, doc/posix-functions/daylight.texi: + * doc/posix-functions/localtime.texi, doc/posix-functions/mktime.texi: + * doc/posix-functions/strftime.texi, doc/posix-functions/timezone.texi: + * doc/posix-functions/tzname.texi, doc/posix-functions/tzset.texi: + * doc/posix-functions/wcsftime.texi: + Mention some issues with TZ under MS-Windows. + 2017-05-01 Bruno Haible copy-file: Fix build error on mingw. diff --git a/doc/posix-functions/ctime.texi b/doc/posix-functions/ctime.texi index 6abc4c4b53..7294f33202 100644 --- a/doc/posix-functions/ctime.texi +++ b/doc/posix-functions/ctime.texi @@ -24,6 +24,9 @@ typically write the timestamp into static buffer. If two threads call @code{ctime} at roughly the same time, you might end up with the wrong date in one of the threads, or some undefined string. There is a re-entrant interface @code{ctime_r}. +@item +Native Windows platforms (mingw, MSVC) support only a subset of time +zones supported by GNU or specified by POSIX. @xref{tzset}. @end itemize A more flexible function is @code{strftime}. However, note that it is diff --git a/doc/posix-functions/daylight.texi b/doc/posix-functions/daylight.texi index d5d7a5c76b..4f40543cfb 100644 --- a/doc/posix-functions/daylight.texi +++ b/doc/posix-functions/daylight.texi @@ -18,4 +18,10 @@ Mac OS X 10.3, FreeBSD 6.0, OpenBSD 3.8, IRIX 6.5, OSF/1 5.1. @item The address of this variable is not a compile-time constant on some platforms: Cygwin, mingw. +@item +Native Windows platforms (mingw, MSVC) support only a subset of time +zones supported by GNU or specified by POSIX. @xref{tzset}. @end itemize + +A more portable way of getting the UTC offset is to use +@code{strftime} with the @code{%z} format. @xref{strftime}. diff --git a/doc/posix-functions/localtime.texi b/doc/posix-functions/localtime.texi index 74d4a6a48e..02d069cc1e 100644 --- a/doc/posix-functions/localtime.texi +++ b/doc/posix-functions/localtime.texi @@ -19,4 +19,7 @@ Portability problems not fixed by Gnulib: On some platforms, this function returns nonsense values for unsupported arguments (like @math{2^56}), rather than failing: FreeBSD 10. +@item +Native Windows platforms (mingw, MSVC) support only a subset of time +zones supported by GNU or specified by POSIX. @xref{tzset}. @end itemize diff --git a/doc/posix-functions/mktime.texi b/doc/posix-functions/mktime.texi index 35a9a41e7e..6187dc79b4 100644 --- a/doc/posix-functions/mktime.texi +++ b/doc/posix-functions/mktime.texi @@ -19,4 +19,7 @@ when the environment variable @code{TZ} has been set by Cygwin. Portability problems not fixed by Gnulib: @itemize +@item +Native Windows platforms (mingw, MSVC) support only a subset of time +zones supported by GNU or specified by POSIX. @xref{tzset}. @end itemize diff --git a/doc/posix-functions/strftime.texi b/doc/posix-functions/strftime.texi index 0c2d992f93..dd52720499 100644 --- a/doc/posix-functions/strftime.texi +++ b/doc/posix-functions/strftime.texi @@ -19,6 +19,9 @@ Portability problems not fixed by Gnulib: The Windows C runtime library (which is used by MinGW) does not support the %e specifier (and possibly the other more recent SUS specifiers too, i.e., %C, %D, %h, %n, %r, %R, %t, and %T). +@item +Native Windows platforms (mingw, MSVC) support only a subset of time +zones supported by GNU or specified by POSIX. @xref{tzset}. @end itemize Extension: Gnulib offers a module @samp{strftime} that provides an diff --git a/doc/posix-functions/timezone.texi b/doc/posix-functions/timezone.texi index dfadb356ed..fa1ae7ef70 100644 --- a/doc/posix-functions/timezone.texi +++ b/doc/posix-functions/timezone.texi @@ -18,4 +18,10 @@ IRIX 6.5, OSF/1 5.1, mingw. @item The address of this variable is not a compile-time constant on some platforms: mingw. +@item +Native Windows platforms (mingw, MSVC) support only a subset of time +zones supported by GNU or specified by POSIX. @xref{tzset}. @end itemize + +A more portable way of getting the UTC offset is to use +@code{strftime} with the @code{%z} format. @xref{strftime}. diff --git a/doc/posix-functions/tzname.texi b/doc/posix-functions/tzname.texi index d28cef0e0a..8441529b9e 100644 --- a/doc/posix-functions/tzname.texi +++ b/doc/posix-functions/tzname.texi @@ -18,4 +18,10 @@ IRIX 6.5, OSF/1 5.1, mingw. @item The address of this variable is not a compile-time constant on some platforms: Cygwin, mingw. +@item +Native Windows platforms (mingw, MSVC) support only a subset of time +zones supported by GNU or specified by POSIX. @xref{tzset}. @end itemize + +A more portable way of getting the time zone abbreviation is to use +@code{strftime} with the @code{%Z} format. @xref{strftime}. diff --git a/doc/posix-functions/tzset.texi b/doc/posix-functions/tzset.texi index a457409352..2e16cb4a08 100644 --- a/doc/posix-functions/tzset.texi +++ b/doc/posix-functions/tzset.texi @@ -19,4 +19,13 @@ Solaris 2.6. Portability problems not fixed by Gnulib: @itemize +@item +Native Windows platforms (mingw, MSVC) support only a subset of +POSIX-specified values for the @env{TZ} environment variable, +consisting of a time zone abbreviation containing exactly three ASCII +letters with no daylight saving time or angle brackets, and with no +support for @code{tz} database settings like +@code{TZ='America/New_York'}. Even this subset does not work on +applications built via the Universal Windows Platform, as it does not +make environment variables like @env{TZ} available to applications. @end itemize diff --git a/doc/posix-functions/wcsftime.texi b/doc/posix-functions/wcsftime.texi index 931b81c1a1..0e4a951cc1 100644 --- a/doc/posix-functions/wcsftime.texi +++ b/doc/posix-functions/wcsftime.texi @@ -21,4 +21,7 @@ OpenBSD 3.8, Minix 3.1.8, IRIX 5.3, Solaris 2.5.1, Cygwin 1.5.x, BeOS. @item On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot accommodate all Unicode characters. +@item +Native Windows platforms (mingw, MSVC) support only a subset of time +zones specified by POSIX. @xref{tzset}. @end itemize