I am curious why a signed integer value was used to hold Unix time. It clearly would have made significantly more sense to use an unsigned integer as time can't go backwards, so having a negative value for time is, well, impossible. However, on January 19, 2038 Unix time will overflow and it will be the end of time as many of us know it. We will go from 2,147,483,647 to -2,147,483,648... Not good.
So, why was a signed integer used and how hard would it be to implement a fix for this when the end of time does come near?
It clearly would have made significantly more sense to use an unsigned integer as time can't go backwards
. No, because obviously you'd want to be able to represent dates before 1970 (eg birthdays of anyone alive at the start of the epoch) or durations/changes in time (eg Then - Now = -5 sec). – Benny Jobigan Apr 24 '20 at 02:18