r/AskComputerScience • u/grawmpy • Dec 09 '25
32-bit computers hit a time calculation wall in 2038. Will they most likely all be phased out by then?
The wall hits 03:14:07 UTC on Tuesday, January 19, 2038. After this the time calculation will roll back over to either December 13, 1901 or January 1, 1970 depending on the implementation. Does anyone think 32-bit architecture computers will still be in service by 2038?
143
Upvotes
View all comments
Show parent comment
2
u/ghjm MSCS, CS Pro (20+) Dec 09 '25
The standard signed bumber format, called 2s complement, was designed to have desirable behavior when wrapping around zero (1 minus 2 "naturally" gives -1, without having to encode special logic to handle the sign). The same wrapping at the other end of the scale means that the largest value plus one equals the smallest (most negative) value. A signed 32-bit integer representing seconds gives a positive or negative range of a little over 68 years. The date chosen for zero is Jan 1 1970, so the maximum positive value is in 2038, and when this value is reached it wraps around to the maximum negative value, in 1901. (Some date libraries ignore negative values, in which case it will wrap around to 1970 and either start counting forward or maybe just stay stuck on 1/1/1970 for 68 years, then start counting forward again.)