Unix time (otherwise referred to as POSIX time) will effectively be rendered unusable at precisely 3:14:08 AM UTC on January 19th of 2038.
The Y2K38 Bug!
This problem has been related to by many as the Unix equivalent of the Y2K bug (also called ‘the year 2038 problem’ or Y2K38). This bug doesn’t just depict that computer software can fail on that given date, but also before.
The problem is most notably present in 32-bit systems. Even though systems that are less than 32-bit will fail well before this date. The majority of commercial personal computer systems, like the ones you and I use, have been primarily 32-bit systems until recently. However, don’t let this alarm you as most commercial operating system software (namely, Microsoft Windows) does not normally rely on Unix Time.
Who Should be Concerned?
The ones most concerned with this catastrophe are those businesses or individuals which run *nix based servers. All flavors of Linux/Unix operating systems rely heavily on Unix time for many purposes. The problem with using POSIX time lies in the computers ability to conduct mathematical/logical operations within its address space. Having a 64-bit processor is not enough. So, the move to 64-bit operating systems has created the additional address space and interpretation necessary to make use of larger signed integers.
What is Unix Time Exactly?
The Unix Time or POSIX Time, used in *nix based operating system software, is the total number of seconds elapsed since January 1st of 1970 at midnight UTC. Since there are 86,400 seconds in a day (not accounting for leap seconds) you can see how quickly this number can grow over the years. It has been over 41 years since we started using Unix Time. Today Unix Time is represented by a signed integer of more than 1.2 Billion. This integer requires a certain number of bits in order for the operating system software, or other software on the computer, to make use of its value. Since the OS relies on hardware to be able to assign these bits to an address space this method of calculating time is limited by both physical (hardware) as well as virtual (software) capabilities of the system. If the computer is using a 64-bit process with a 64-bit OS we are able to increase the number of bits that can be used to make up an integer in our address space.
What Are the Limitations?
The limitations and inefficiencies of Unix Time are based on the fact that it uses more memory as time increases. In contrast the more human readable time that we use to distinguish dates does not increase the computers need for memory (address space) in such a linear fashion as Unix Time.
The largest possible signed integer on a 32-bit system is 2,147,483,647 which consumes a total of 31 bits of address space (31 1′s). The last bit is used to sign the integer (whether it’s positive or negative). This means we can only use up to that many seconds in a Unix time stamp on a 32-bit system (whether going back from or forward into the epoch). This equates to roughly 68 years since the epoch (the start of Unix Time in 1970).
The way we derive the largest possible integer from the number of bits is by calculating the bits (bits are either 0 or 1) to the power of number of bits used. So 2^32 = 4,294,967,296. Now, since a signed integer will use one bit we can only make use of half of this decimal representation of seconds in either direction of the epoch.
Many solutions have been proposed to solve the year 2038 problem. One way we are attempting to solve this problem is by moving to 64-bit systems.
So, how does a 64-bit system solve our problem? In all honesty, it doesn’t. However, it does allow us to continue using Unix Time for a lot longer without having to worry about running out of address space for many – many more millenniums to come. The largest possible signed integer value on a 64-bit system is 9,223,372,036,854,775,807 [2^64 / 2] – which gives us over 292 billion more years that we can continue using Unix Time without ever worrying about running out of address space. Most likely our bones will have turned to dust by the time Unix time is no longer usable on 64-bit systems. The more likely scenario is that computers will continue to increase in compute power, virtually eliminating our need for worry.
So Why Should We Use Unix Time?
Just based on its limitations and all of its inefficiencies Unix Time doesn’t sound very appealing to us humans. However, it is very appealing to machines, which do not understand words as easily as humans. Machines understand numbers and that’s all a Unix time stamp provides. One large integer value that we can effectively use to calculate dates on a computer.
You and I can easily understand a date like January 1st of 1970, or 12/31/2010 or even 30-6-1999, but computers can not. Unix Time solves all of this for us by giving the computer something it can easily understand and work with in order to translate between human-readable and machine-readable dates. It also resolves our messy depiction of time zones as Unix Time does not care about time zone offsets.
So in summation, Unix Time is clearly inefficient in terms of its impact on compute power based on its linear growth. However, it effectively helps computers translate between human-to-machine readable dates and vice-versa.
Since the inception of Unix time, we have come to realize the ability for computers to process larger amounts of data at one time (per logical operation) is the caveat of using such a linear system. Though it has become evident that as such systems grow over time so does technology.