7127674a251060ae7aae3bade486f8b5f164d8ec
[gnulib.git] / doc / posix-functions / ctime.texi
1 @node ctime
2 @section @code{ctime}
3 @findex ctime
4
5 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/ctime.html}
6
7 Gnulib module: ---
8
9 Portability problems fixed by Gnulib:
10 @itemize
11 @end itemize
12
13 Portability problems not fixed by Gnulib:
14 @itemize
15 @item
16 This function may overflow its internal buffer if an invalid year is passed.
17 @item
18 The @code{ctime} function need not be reentrant, and consequently is
19 not required to be thread safe.  Implementations of @code{ctime}
20 typically write the time stamp into static buffer.  If two threads
21 call @code{ctime} at roughly the same time, you might end up with the
22 wrong date in one of the threads, or some undefined string.  There is
23 a re-entrant interface @code{ctime_r}.
24 @end itemize
25
26 A more flexible function is @code{strftime}.  However, note that it is
27 locale dependent.