public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] Improve doc for time_t range (BZ 31808)
@ 2024-06-04 16:04 Paul Eggert
  0 siblings, 0 replies; only message in thread
From: Paul Eggert @ 2024-06-04 16:04 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=400bdb5c85af5a52b3f5653357c9fca87f036bd3

commit 400bdb5c85af5a52b3f5653357c9fca87f036bd3
Author: Paul Eggert <eggert@cs.ucla.edu>
Date:   Tue May 28 10:07:47 2024 -0700

    Improve doc for time_t range (BZ 31808)

Diff:
---
 manual/time.texi | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/manual/time.texi b/manual/time.texi
index dd77d3db04..2d3833755f 100644
--- a/manual/time.texi
+++ b/manual/time.texi
@@ -123,7 +123,7 @@ The number of clock ticks per second is system-specific.
 @code{time_t} is the simplest data type used to represent simple
 calendar time.
 
-In ISO C, @code{time_t} can be either an integer or a floating-point
+In ISO C, @code{time_t} can be either an integer or a real floating
 type, and the meaning of @code{time_t} values is not specified.  The
 only things a strictly conforming program can do with @code{time_t}
 values are: pass them to @code{difftime} to get the elapsed time
@@ -134,11 +134,21 @@ and pass them to the functions that convert them to broken-down time
 On POSIX-conformant systems, @code{time_t} is an integer type and its
 values represent the number of seconds elapsed since the @dfn{epoch},
 which is 00:00:00 on January 1, 1970, Coordinated Universal Time.
+The count of seconds ignores leap seconds.
 
 @Theglibc{} additionally guarantees that @code{time_t} is a signed
 type, and that all of its functions operate correctly on negative
 @code{time_t} values, which are interpreted as times before the epoch.
+Functions like @code{localtime} assume the Gregorian calendar even
+though this is historically inaccurate for timestamps before the
+calendar was introduced or after the calendar will become obsolete.
 @cindex epoch
+@Theglibc{} also supports leap seconds as an option, in which case
+@code{time_t} counts leap seconds instead of ignoring them.
+Currently the @code{time_t} type is 64 bits wide on all platforms
+supported by @theglibc{}, except that it is 32 bits wide on a few
+older platforms unless you define @code{_TIME_BITS} to 64.
+@xref{Feature Test Macros}.
 @end deftp
 
 @deftp {Data Type} {struct timespec}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-06-04 16:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-04 16:04 [glibc] Improve doc for time_t range (BZ 31808) Paul Eggert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).