diff --git a/contrib/tzcode/stdtime/ctime.3 b/contrib/tzcode/stdtime/ctime.3 --- a/contrib/tzcode/stdtime/ctime.3 +++ b/contrib/tzcode/stdtime/ctime.3 @@ -30,7 +30,7 @@ .\" From: @(#)ctime.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd March 4, 2022 +.Dd September 10, 2022 .Dt CTIME 3 .Os .Sh NAME @@ -80,9 +80,7 @@ and .Fn localtime all take as an argument a time value representing the time in seconds since -the Epoch (00:00:00 -.Tn UTC , -January 1, 1970; see +the Epoch (00:00:00 UTC , January 1, 1970; see .Xr time 3 ) . .Pp The function @@ -112,9 +110,7 @@ .Fa tm_isdst Ns 'th element of .Fa tzname -to a pointer to an -.Tn ASCII -string that is the time zone abbreviation to be +to a pointer to an ASCII string that is the time zone abbreviation to be used with .Fn localtime Ns 's return value. @@ -183,8 +179,7 @@ pointed to by tm into a time value with the same encoding as that of the values returned by the .Xr time 3 -function (that is, seconds from the Epoch, -.Tn UTC ) . +function (that is, seconds from the Epoch, UTC) . The .Fn mktime function @@ -195,7 +190,7 @@ .Fn timegm function interprets the input structure as representing Universal Coordinated Time -.Pq Tn UTC . +.Pq UTC . .Pp The original values of the .Fa tm_wday @@ -286,10 +281,8 @@ .Pp The field .Fa tm_gmtoff -is the offset (in seconds) of the time represented from -.Tn UTC , -with positive -values indicating east of the Prime Meridian. +is the offset (in seconds) of the time represented from UTC, +with positive values indicating east of the Prime Meridian. .Sh SEE ALSO .Xr date 1 , .Xr clock_gettime 2 , @@ -363,6 +356,12 @@ .Fn localtime_r have been available since .Fx 8.0 . +.Sh CAVEATS +The +.Fn localtime +function returns a NULL pointer, if the passed in time translates to a year +that will not fit in an integer type. +It is stricly recommended to check the return value to avoid garage output. .Sh BUGS Except for .Fn difftime , @@ -376,13 +375,10 @@ function will modify the same object. .Pp The C Standard provides no mechanism for a program to modify its current -local timezone setting, and the -.Tn POSIX Ns No \&-standard +local timezone setting, and the POSIX-standard method is not reentrant. (However, thread-safe implementations are provided -in the -.Tn POSIX -threaded environment.) +in the POSIX threaded environment.) .Pp The .Va tm_zone