From be62d5918223b4df209cc941633b8c5b80cc0d20 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Mon, 28 Oct 2024 09:17:10 -0700
Subject: [PATCH] Talk a bit more about tm_isdst's obsolescence
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This is in response to a question by Florian Weimer in:
https://lists.iana.org/hyperkitty/list/tz@iana.org/message/NACFDAG2G4PZEL5LKDYOOZL6U4B7WPP3/
* theory.html (POSIX features no longer needed):
Update tm_isdst discussion.
(Other portability notes): Don’t suggest tzname.
---
 theory.html | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/theory.html b/theory.html
index d3573ede..b1717e7d 100644
--- a/theory.html
+++ b/theory.html
@@ -1201,12 +1201,15 @@ The vestigial <abbr>API</abbr>s are:
     The <code>tm_isdst</code> member is almost never needed and most of
     its uses should be discouraged in favor of the abovementioned
     <abbr>API</abbr>s.
+    It was intended as an index into the <code>tzname</code> variable,
+    but as mentioned previously that usage is obsolete.
     Although it can still be used in arguments to
     <code>mktime</code> to disambiguate timestamps near
     a <abbr>DST</abbr> transition when the clock jumps back on
     platforms lacking <code>tm_gmtoff</code>, this
-    disambiguation does not work when standard time itself jumps back,
-    which can occur when a location changes to a time zone with a
+    disambiguation works only for proleptic <code>TZ</code> strings;
+    it does not work in general for geographical timezones,
+    such as when a location changes to a time zone with a
     lesser <abbr>UT</abbr> offset.
   </li>
 </ul>
@@ -1223,8 +1226,8 @@ The vestigial <abbr>API</abbr>s are:
     Programs that in the past used the <code>timezone</code> function
     may now examine <code>localtime(&amp;clock)-&gt;tm_zone</code>
     (if <code>TM_ZONE</code> is defined) or
-    <code>tzname[localtime(&amp;clock)-&gt;tm_isdst]</code>
-    (if <code>HAVE_TZNAME</code> is nonzero) to learn the correct time
+    use <code>strftime</code> with a <code>%Z</code> conversion specification
+    to learn the correct time
     zone abbreviation to use.
   </li>
   <li>
-- 
2.43.0

