2038 is closer than it seems
2038 is closer than it seems
Posted May 23, 2014 16:24 UTC (Fri) by ScottMinster (subscriber, #67541)Parent article: 2038 is closer than it seems
Would it be possible to change the epoch date? For example, setting an environment variable like $EPOCH_YEAR to 2010 would make the 32 bit time_t relative to midnight UTC, January 1, 2010. Methods like localtime() would take this offset into account. Somehow, the kernel would have to be informed that the process is running with an epoch offset, but presumably that could be done during the process startup in glibc.
Obviously this wouldn't solve situations where the time_t value is recorded outside the process (in a file, sent over the network, etc), so this wouldn't work for some subset of applications. But most applications probably do not do that, so this workaround seems like it could be effective in cases where recompiling is not possible or desirable.
