It seems surprisingly hard to figure out what is the valid range of values ββfor time_t .
It is 32 bit on some platforms, on most 64 bits, and therefore it can be easily installed on LONG_MAX . However, trying to use this value does not really work as expected. For example, you cannot pass it to localtime and change it to struct tm .
A quick test program for binary value search tells me that it is 67768036191676799. This corresponds to the end of the year 2147483647, so it makes sense as a value. But is this stated anywhere, and is there a reasonable, platform-independent value for maximizing the use of time_t?
asc99c
source share