[tz] [PROPOSED] Document deprecation of ctime, asctime.
Paul Eggert
eggert at cs.ucla.edu
Wed Dec 21 21:46:28 UTC 2022
---
newctime.3 | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/newctime.3 b/newctime.3
index e25d841..2790c81 100644
--- a/newctime.3
+++ b/newctime.3
@@ -11,13 +11,13 @@ asctime, ctime, difftime, gmtime, localtime, mktime \- convert date and time
.PP
.BR "extern char *tzname[];" " /\(** (optional) \(**/"
.PP
-.B char *ctime(time_t const *clock);
+.B [[deprecated]] char *ctime(time_t const *clock);
.PP
.B char *ctime_r(time_t const *clock, char *buf);
.PP
.B double difftime(time_t time1, time_t time0);
.PP
-.B char *asctime(struct tm const *tm);
+.B [[deprecated]] char *asctime(struct tm const *tm);
.PP
.B "char *asctime_r(struct tm const *restrict tm,"
.B " char *restrict result);"
@@ -91,6 +91,15 @@ introduction of UTC and are some other flavor of Universal Time (UT).
Some implementations support leap seconds, in contradiction to POSIX.
.PP
The
+.B ctime
+function is deprecated starting in C23.
+Callers can use
+.B localtime_r
+and
+.B strftime
+instead.
+.PP
+The
.B localtime
and
.B gmtime
@@ -128,6 +137,10 @@ converts a time value contained in a
structure to a string,
as shown in the above example,
and returns a pointer to the string.
+This function is deprecated starting in C23.
+Callers can use
+.B strftime
+instead.
.PP
The
.B mktime
--
2.38.1
More information about the tz
mailing list