4 ms·
Back when I first heard about this, I wondered if it wouldn't be possible to simpy add an extra byte to the date. That would last us until the end of the univer
by mcv 13y ago
Back when I first heard about this, I wondered if it wouldn't be possible to simpy add an extra byte to the date. That would last us until the end of the universe.
I still don't know enough about OSs to know how feasible it is, but back then, the move towards 64 bit OSs seemed like a great opportunity to make this change. Maybe when we move to 128 bit systems we can finally do this? I'd like not to postpone this until the last minute like last time.
- ygra 13y agoThe move to a 64-bit is sufficient, or at least a 64-bit time_t suffices for the very foreseeable future. Adding just one byte doesn't gain you much because neither CPUs, nor most programming languages deal well with a 36-bit type – you'd end up with a 64-bit type anyway in most cases which is nicer to handle. The question probably is why a 32-bit type was deemed sufficient back then, but as others have noted, it is very hard to anticipate the lifetime of software and it was a pragmatic tradeoff between anticipated OS lifetime and necessary storage space. There are other problems as well, though. time_t is a type designed for keeping track of the current time of a computer system, therefore an arbitrary cutoff point in the past is sufficient. But then it got used for all kinds of other things – storing people's birthdays, using it as internal representation for a DateTime type, etc. Those have been problematic ever since because a possible date range of 1901–2038 is not necessarily sufficient for those use cases. Fact is, though, that for keeping time in a computer a simple scalar that counts units since a reference date is the easiest and most efficient solution. Over time there have been plenty of such reference dates (epochs) [½], the most notable these days probably Unix (1970-01-01), popular spreadsheets (around 1900-01-01) or Windows (1601-01-01). [½] http://en.wikipedia.org/wiki/Epoch_(reference_date)#Notable_epoch_dates_in_computing http://en.wikipedia.org/wiki/Epoch_(reference_date)#Notable_...
- rjsw 13y agoSeveral OSs have already made the switch to 64-bit time_t, I'm typing this on one.
- ygra 13y agoThe problem is most likely with legacy and embedded systems. The sort that are running somewhere for decades, unnoticed. Until they fail some day and panic happens. And they're not easily upgradeable either.
- TheCoelacanth 13y agoAdding another byte would only make it last another ~17000 years, not until the end of the universe.
- weswalker125 13y agoThat, or he's not too optimistic about the lifespan of our universe :\