]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
Note that POSIX requires localtime() to act as though tzset()
authorMichael Kerrisk <mtk.manpages@gmail.com>
Thu, 14 Feb 2008 16:19:05 +0000 (16:19 +0000)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Thu, 14 Feb 2008 16:19:05 +0000 (16:19 +0000)
was called, but localtime_r() does not have the same requirement.
See also http://thread.gmane.org/gmane.comp.time.tz/2034/

man3/ctime.3

index 397a70bff581362f710a4947cd6a38ae80b37bdf..03b45397d71777493a705dacbf29498e7ecd28a8 100644 (file)
@@ -285,6 +285,19 @@ defined when
 was set before including
 .IR <time.h> .
 This is a BSD extension, present in 4.3BSD-Reno.
+
+According to POSIX.1-2004,
+.BR localtime ()
+is required to behave as though
+.BR tzset ()
+was called, while
+.BR localtime_r ()
+does not have this requirement.
+.\" See http://thread.gmane.org/gmane.comp.time.tz/2034/
+For portable code
+.BR tzset ()
+should be called before
+.BR localtime_r ().
 .SH "SEE ALSO"
 .BR date (1),
 .BR gettimeofday (2),