I’ve been writing code for a living for decades, and I’ve been losing a tiny bit of sleep over this very problem since the 90’s. In 1999 I even called into C-SPAN when they had a government “expert” guest on there talking about Y2K and I said this Y2K crap is nothing compared to 2038. They basically thought I was nuts.

The other answers are totally oversimplifying the problem. Saying “it’s simple, just use 64 bits for time_t” is much like saying “Y2K is no problem, just use 4 digits for the year”. The problem is in the IMPLEMENTATION of that. Tracking everything down and then fixing it.

I don’t care if the latest kernel is fine. That’s not the issue. Think of all the embedded hardware that’s out there right now and quite possibly will still be kicking in 20 years. And more importantly all the executables. It doesn’t matter if your kernel uses 64 bits internally when the compiled executable uses a 32 bit value for the time. And think of all the data structures which have only allocated 4 bytes per record.

Yeah you just need to go through and find all that. It’s “simple”, eh? Y2K was child’s play compared to how 2038 could turn out:

With Y2K we “just” had to look for dates for the most part. It was still quite a chore but you had a pretty good idea where dates were being used. But with 2038 you have no clue. Looking for dates and times-of-day will NOT cut it. The code that decides when it’s time to update the radar display (for example) or put the airplane flaps up may be comparing two of these 32 bit times but they are not displayed/stored anywhere. Just try looking for anything that might have a timer, that’s about everything. That time value is also used for things which have nothing to do with time at all — as the seed to a random number generator or as a unique ID value, perhaps. And they might not play nice with negative values! And don’t think you can search the source code (if you even have it) for time_t or time() because another library may have represented it as a plain integer and returned it to you that way. It will not be fun trying to find all this stuff.

If all you do (as a user or a company) is install off-the-shelf software and it’s always the latest and greatest every friggin’ 2 years, then you’ve got little to worry about. But that is NOT how the world works. If that’s all you’re doing then you’re just using machines as toys, as a consumer. But step out into the real world and you’ll see the scope of the problem.

I could go on for pages with concrete examples but I doubt you’re interested unless you do this for a living.

And if you think this only affects unix, think again. The time_t value you refer to is used in tons of user-level code on all operating systems. It’s just convenient to deal with a 32 bit int which can be added/subtracted rather than some convoluted structs. And sometimes the developer doesn’t even know it’s being used because it’s buried in a deeper library and the source is long gone — these are the kinds of problems that make this a nightmare.

View 12 other answers to this question
About · Careers · Privacy · Terms · Contact · Languages · Your Ad Choices · Press ·
© Quora, Inc. 2025