[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
 .BR "extern char *tzname[];" " /\(** (optional) \(**/"
-.B char *ctime(time_t const *clock);
+.B [[deprecated]] char *ctime(time_t const *clock);
 .B char *ctime_r(time_t const *clock, char *buf);
 .B double difftime(time_t time1, time_t time0);
-.B char *asctime(struct tm const *tm);
+.B [[deprecated]] char *asctime(struct tm const *tm);
 .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.
+.B ctime
+function is deprecated starting in C23.
+Callers can use
+.B localtime_r
+.B strftime
 .B localtime
 .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
 .B mktime

More information about the tz mailing list