LinuxSoftware

Coding and tramping in Aotearoa / New Zealand

Car insurance

Oct 15

Dinner

, , david, Thursday, 11:53 pm

dinner

Pumpkin, leeks, carrots, broccoli, and lamb. Mmmm.


Apr 5

Food, drink and Unix time_t

, , , , , , , , , david, Saturday, 10:38 pm

Teh Tarik Andi was up in Auckland for the weekend in search of some good Malaysian food. Caught up with him, and Tim, Kelvin, Ciprian & Emma, and Simon at Galbraith’s and then Tim, Andi and I had dinner at Selera where we met up with Carl & Grace. Tried Teh Tarik which was strong and sweet, nice!

The end of Unix time came up over beers as it does in such social gatherings. I couldn’t remember the date, but described it as my retirement plan. I’ve just followed the definition of time_t from <time.h> back to <bits/types.h> and calculated it will run out on 32 bit systems in Sunday, 18 January 2038, hopefully I will already be retired by then.

time_t on my computer is a __time_t which is defined to be __TIME_T_TYPE which is a __SLONGWORD_TYPE which finally works out to be a long int. That’s signed so it can only hold 2147483648 (231) seconds before it wraps. It counts from the Unix Epoch of 1970, so that gives us 30 years to upgrade all Unix based systems to 64 bits. With 64 bits Unix time will last until the year 292471210647 (+/- a few for leap seconds).