summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2023-04-23 00:18:48 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2023-04-23 00:19:14 -0700
commit5a220576fde1f7d3b6f716702d93fae08dbd2268 (patch)
tree510df5713bbc83d71a4bc54edbb48deaecdc332a
parentb019d3a8b3c544d4bbbdb0541acbea5238fcf781 (diff)
downloadtz-5a220576fde1f7d3b6f716702d93fae08dbd2268.tar.gz
Add comments re offtime, timeoff, timelocalHEADmain
-rw-r--r--Makefile4
-rw-r--r--localtime.c7
2 files changed, 10 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 6edc73c..8017a14 100644
--- a/Makefile
+++ b/Makefile
@@ -353,9 +353,11 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \
# functions to be added to the time conversion library.
# "offtime" is like "gmtime" except that it accepts a second (long) argument
# that gives an offset to add to the time_t when converting it.
-# "timelocal" is equivalent to "mktime".
+# I.e., "offtime" is like calling "localtime_rz" with a fixed-offset zone.
+# "timelocal" is nearly equivalent to "mktime".
# "timeoff" is like "timegm" except that it accepts a second (long) argument
# that gives an offset to use when converting to a time_t.
+# I.e., "timeoff" is like calling "mktime_z" with a fixed-offset zone.
# "posix2time" and "time2posix" are described in an included manual page.
# X3J11's work does not describe any of these functions.
# These functions may well disappear in future releases of the time
diff --git a/localtime.c b/localtime.c
index 818d58f..7cd43dc 100644
--- a/localtime.c
+++ b/localtime.c
@@ -1703,6 +1703,9 @@ gmtime(const time_t *timep)
#if STD_INSPIRED
+/* This function is obsolescent and may disappear in future releases.
+ Callers can instead use localtime_rz with a fixed-offset zone. */
+
struct tm *
offtime(const time_t *timep, long offset)
{
@@ -2313,6 +2316,8 @@ mktime(struct tm *tmp)
}
#if STD_INSPIRED
+/* This function is obsolescent and may disapper in future releases.
+ Callers can instead use mktime. */
time_t
timelocal(struct tm *tmp)
{
@@ -2323,6 +2328,8 @@ timelocal(struct tm *tmp)
#else
static
#endif
+/* This function is obsolescent and may disapper in future releases.
+ Callers can instead use mktime_z with a fixed-offset zone. */
time_t
timeoff(struct tm *tmp, long offset)
{