| General > General Technical Chat |
| UNIX rollover - why 2^31 signed and not 2^32 unsigned? |
| (1/4) > >> |
| Circlotron:
We all know that if nothing is done, UNIX will conk out early 2038 because there are 2^31 seconds from 1 January 1970 till 19th January 2038. My question is - why was a signed integer that has a maximum positive value of 2^31 used as the seconds counter when an unsigned integer value of 2^32 could have been chosen? That would give a counter twice as long. The only reason I can think of is, being signed, it could also deal with negative numbers, that is, dates earlier than 1 January 1970. Does that make any sense at all? Is that how it works? https://en.wikipedia.org/wiki/Year_2038_problem |
| Someone:
History: https://en.wikipedia.org/wiki/Unix_time#Representing_the_number |
| BrianHG:
I just feel it's sad that those who wanted to create an ultimate OS for everyone would settle on a time format which couldn't even make it to 2050, let alone 2100. Maybe this short-sight means unix should be dumped? |
| langwadt:
--- Quote from: BrianHG on May 05, 2022, 01:09:51 am ---I just feel it's sad that those who wanted to create an ultimate OS for everyone would settle on a time format which couldn't even make it to 2050, let alone 2100. Maybe this short-sight means unix should be dumped? --- End quote --- isn't most platforms and timestamps 64bit already? |
| BrianHG:
--- Quote from: langwadt on May 05, 2022, 01:17:13 am --- --- Quote from: BrianHG on May 05, 2022, 01:09:51 am ---I just feel it's sad that those who wanted to create an ultimate OS for everyone would settle on a time format which couldn't even make it to 2050, let alone 2100. Maybe this short-sight means unix should be dumped? --- End quote --- isn't most platforms and timestamps 64bit already? --- End quote --- It's not that, it's that they begun with only 31bits of time expecting that they would burn, fail and be completely forgotten by 2038. |
| Navigation |
| Message Index |
| Next page |