This is my second question relating to DateTime. We test our application for all known possibilities of bugs. I came across this issue a year back and after a lot of research I posted an article on CodeProject on this topic. This article will explain the what year 2038 bug is and how it can many of our applications tomorrow. Explaining full details of year 2038 bug was beyond the scope of this question so I've referred to an article which has been written by myself only.

Link text: http://www.codeproject.com/KB/bugs/The-Year-2038-Bug.aspx

What are the applications (server apps, client apps, infrastructure solutions s/w & h/w) which we are using currently that are vulnerable to this bug ?

What are the solutions for the year 2038 bug? How is it possible to upgrade our solutions and applications to deal against the problem?

This question is very futuristic but it's worth the discussion.


4 Answers 4


I expect small embedded systems to be most at risk. These are the small systems that runs our elevators, gps receivers, car computer etc. A lot of these devices will still be operating in 2038 with no way to "go online" to check for firmware updates.


The short answer is almost any 32-bit OS using unix timestamps.

Some 32-bit versions were fixed to use 64-bit time, however that's always only an option.

Similarly some 64-bit OS' still use a 32-bit time_t and so are still open to wraparound.

In the 30 years still to come before the problem hits I think speculating is not sensible. Make sure anything new uses 64-bit timestamps, and by 2038 there will be very little still around using 32-bit timestamps.

  • 2
    Only 19 years still to come, now. Time's a-flying... :-)
    – SusanW
    Sep 13, 2019 at 12:04

I have a feeling, that we are much worse off than we might think:

By 2038, time_t will of course be 64 bit wide on the majority of the systems (just remember where we were 30 years ago), so that one doesn't really matter.

What I perceive to be much more of the problem is many protocols out there that specify 32 bit timestamps as part of their inner workings. NTP, SSL - choose your pick.

Even when the world has moved on and everyone is using 64bit machines, these protocols are sure to be still in use (SMTP was introduced ~30 years ago and still is in wide use, whereas hardware introduced back then isn't really - just to make a point here).

  • Yes, I've discussed this on my article and proposed as one of the solution.
    – s_ruchit
    May 27, 2009 at 10:01

What are the applications (server apps, client apps, infrastructure solutions s/w & h/w) which we are using currently that are vulnerable to this bug ?

Hardware mostly isn't directly affected, most real time clock chips do not work in unix-time. Even if they did there are relatively easy workarounds. This is a software problem first and foremost.

Most 32-bit Unix-like systems and the applications running on them are badly affected. They have 32-bit time_t as a central component of the platform ABI.

64-bit Unix-like systems normally use 64-bit time as their main representation, so they aren't as badly affected, but some impact is still likely due to sloppy code that passes time around using the wrong data types or due to file formats that are designed around 32-bit Unix time.

What are the solutions for the year 2038 bug?

The normal soloution is to replace 32-bit time with 64-bit time. How difficult that is depends on the scenario. If it's just an internal variable or parameter that isn't exposed on any stable external ABIs then it's fairly easy to fix.

On the other hand replacing it in the platform ABI is hard to do without having a "flag day" where everything has to be rebuilt at once or creating two seperate worlds of legacy software and current software with completely seperate sets of libraries.

It can be done, through an approach similar to that taken for large file support, but time spreads far more broadly through the platforms libraries than file size does.

For file formats, a transition period is likely to be required. First a new version of the format is defined, then the software needs to be upgraded to read the new format. Finally the software needs to start writing files in the new format.

In some situations an alternative soloution may be to stick to 32-bit but change the time window, for example if you know that your system will not have any pre-1970 timestamps and does not use negative numbers as flag values, you might choose to move to a 32-bit unsigned quantity.

How is it possible to upgrade our solutions and applications to deal against the problem?

For full-sized servers you are probablly already running a 64-bit OS, so the basic underlying platform stuff should already be there and you can focus on looking for issues in your applications. Spin up a server with a future date and see what breaks.

For embedded stuff where running a 64-bit OS isn't reasonable or even possible things look much less rosy. Until/unless the major upstream libraries and distros get things sorted out on their side it's difficult to do anything at the application level.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.