The type of time_t (was: struct tm -> time_t converter wanted)

Guy Harris guy at auspex.UUCP
Fri Oct 28 10:00:29 AEST 1988


>With the Epoch defined as it is for Unix (Jan 1 00:00:00, 1970), it is
>desireable to have a signed `time_t' type.  Although I didn't, the world
>did exist before 1970.

The world also existed before whatever 1902 or so; having "time_t" be
signed will help only to a limited degree.  If you want a type to be
used for time-stamping arbitrary events in the past and the future,
"time_t" on UNIX systems isn't going to be it no matter whether it's
signed or unsigned, unless you make it bigger than 32 bits (in which
case signedness will probably be irrelevant).  However, "time_t" is
generally used to time-stamp events occurring on a UNIX machine, and
there were relatively few of them around before 1970....



More information about the Comp.std.c mailing list