Al Bowers said:
Soo, you should avoid asserting that time_t should be type long and
the precision is seconds since some date in 1970. These may be true
for your implementation of the language but there are many in this
newsgroup who have implementations of the language that do not use
your asserted range and/or precision.
Quite correct.
Note that the convention of making time_t an integer type with
one-second granularity, with 0 representing midnight 1970-01-01, goes
back to the early days of Unix and C (before the ANSI/ISO C standard).
This convention spread to many other implementations. I've seen
implementations where time_t is a 64-bit type, and ones where it's
unsigned rather than signed, but I don't believe I've ever used one
with a granularity other than 1 second or an epoch other than
1970-01-01.
That's not, of course, to say that such implementations don't exist,
just that it's all to easy to assume that they don't. Writing
portable code isn't just about making it work on every implementation
you've seen; you have to understand the standard and avoid making any
unjustified assumptions about implementations you haven't seen.