r/AskComputerScience • • 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?

144 Upvotes

138 comments sorted by

View all comments

Show parent comment

1

u/flatfinger Dec 09 '25

Prior to Javascript, VB6 (Visual BASIC 6) used double-precision floating-point values for dates/times as well. If I recall, each unit represented 86,400 seconds. This could accommodate sub-second accuracy even though there was no integer data type bigger than a 32-bit signed integer. Like it or not, a lot of production code was written in that.

1

u/TheSkiGeek Dec 09 '25

Yet another reason I’m glad to have avoided ever working in VB.

1

u/flatfinger Dec 09 '25

On a list of things not to like about VB6, I don't think the use of floating-point values for date/timestamps would even make the top 100.

1

u/Langdon_St_Ives Dec 09 '25

So the second example to cite for languages that use floats to store time is the only language with a worse design than JS. Way to go.

1

u/flatfinger Dec 09 '25

In a language which lacks 64-bit integer types, use of a double-precision float for values that would be too big for 32-bit integers but will fit in 51 bits makes a lot of sense. People take long integer types for granted these days, but they weren't always available. Using a single number to represent a time stamp is a lot more convenient than having to work with separate upper and lower portions.

1

u/Langdon_St_Ives Dec 09 '25

A lack of robust integer types is a major design flaw whichever way you look at it.

1

u/flatfinger Dec 10 '25

Double-precision floating-point format can precisely represent all values of a 32-bit integer, and Javascript bitwise operators work just as they would on 32-bit integers. Javascript does support array-of-integer types, and for most tasks the performance downsides of using floating-point are small enough not to matter.

Unless a language is going to support separate integer- and floating-point division operators, having only one kind of non-array number is a cleaner design than having multiple types.

1

u/andrew-mcg Dec 11 '25

Sinclair Basic had a 40-bit floating-point representation that stored 17-bit signed integers as such internally, and a 39-bit float for everything else.

No native support for dates and times though.