10.67.10 ctime_r ¶
Removed in POSIX.1-2024.
POSIX.1-2017 specification:
https://pubs.opengroup.org/onlinepubs/9799919799/functions/ctime_r.html
Gnulib module: extensions
Portability problems fixed by Gnulib:
- This function has an incompatible declaration on some platforms:
Solaris 11.4 (when
_POSIX_PTHREAD_SEMANTICS is not defined).
Portability problems not fixed by Gnulib:
- This function is missing on some platforms:
mingw, MSVC 14.
- This function is removed in POSIX.1-2024.
Use the functions
localtime_r and strftime
(or even sprintf) instead.
However, localtime_r can fail and strftime is locale dependent.
- This function may overflow its output buffer if its argument
specifies a time before the year 1000 or after the year 9999.
See
ctime.
- This function may dereference an internal null pointer if its argument
specifies a time before the year
INT_MIN+1900 or after the
year INT_MAX+1900.