diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2024-05-28 10:07:47 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2024-06-04 09:04:04 -0700 |
commit | 400bdb5c85af5a52b3f5653357c9fca87f036bd3 (patch) | |
tree | d19e280a26270cefee402943efd9d903729d08b3 /manual | |
parent | cafef3eb21db24f2e8113b0adc12c0f15d4dec41 (diff) | |
download | glibc-400bdb5c85af5a52b3f5653357c9fca87f036bd3.zip glibc-400bdb5c85af5a52b3f5653357c9fca87f036bd3.tar.gz glibc-400bdb5c85af5a52b3f5653357c9fca87f036bd3.tar.bz2 |
Improve doc for time_t range (BZ 31808)
Diffstat (limited to 'manual')
-rw-r--r-- | manual/time.texi | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/manual/time.texi b/manual/time.texi index dd77d3d..2d38337 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} |