Discussion:
[PATCH] tzset: update doc for TZ problems on MS-Windows
Paul Eggert
2017-05-02 01:02:06 UTC
Permalink
* 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.
---
ChangeLog | 10 ++++++++++
doc/posix-functions/ctime.texi | 3 +++
doc/posix-functions/daylight.texi | 6 ++++++
doc/posix-functions/localtime.texi | 3 +++
doc/posix-functions/mktime.texi | 3 +++
doc/posix-functions/strftime.texi | 3 +++
doc/posix-functions/timezone.texi | 6 ++++++
doc/posix-functions/tzname.texi | 6 ++++++
doc/posix-functions/tzset.texi | 9 +++++++++
doc/posix-functions/wcsftime.texi | 3 +++
10 files changed, 52 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index c9b6146..ad44003 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2017-05-01 Paul Eggert <***@cs.ucla.edu>
+
+ 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 <***@clisp.org>

copy-file: Fix build error on mingw.
diff --git a/doc/posix-functions/ctime.texi b/doc/posix-functions/ctime.texi
index 6abc4c4..7294f33 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 d5d7a5c..4f40543 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 74d4a6a..02d069c 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 35a9a41..6187dc7 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 0c2d992..dd52720 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 dfadb35..fa1ae7e 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 d28cef0..8441529 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 a457409..2e16cb4 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 931b81c..0e4a951 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
--
2.9.3
Bruno Haible
2017-05-02 05:49:46 UTC
Permalink
Post by Paul Eggert
--- a/doc/posix-functions/tzset.texi
+++ b/doc/posix-functions/tzset.texi
@@ -19,4 +19,13 @@ Solaris 2.6.
@itemize
+Native Windows platforms (mingw, MSVC) support only a subset of
+consisting of a time zone abbreviation containing exactly three ASCII
+letters with no daylight saving time or angle brackets, and with no
+applications built via the Universal Windows Platform, as it does not
Thanks. Really funny, this detail in the syntax description of TZ [1]:

"The C run-time library assumes the United States' rules for
implementing the calculation of daylight saving time (DST)."

[1] https://msdn.microsoft.com/en-us/library/90s5c885.aspx

Loading...