Pro!

2038-01-18 21:14:08. The time that shall destroy mankind. Or at least every 32-bit program that uses time_t.

I just ran across this random tidbit of information because I was testing a new calendar application that I had just created that dynamically creates calendars based on any datetime that you specify as the reference point. Well, in my testing, I wanted to know what day (Mon, Tues, Wed, etc) my birthday would be on when I turned 100. Well, not knowing about the 2038-01-18 21:14:08 problem, I put in 2085-05-05 12:00:00.

Well, crap. Instead of getting a visual calendar of May 2085, I got a visual calendar of December 1969. I knew right then that I had stumbled across one of those breaking points that every programmer hates to see: an impending fundamental change would be necessary to produce time_t based functionality past a certain date. Instead of being prudent with my time, I started just guessing high-low style until I had found that breaking point.

2038-01-18 21:14:07 works just fine.
2038-01-18 21:14:08 doesn't.

The reason why is a lot more . . . well, interesting. Converted to Timestamp, 2038-01-18 21:14:07 is 2147483647. I know somebody out there in Pownce land recognizes that number. That is the maximum number that a 32-bit computer can store as a signed integer. Unsigned integers can store significantly larger numbers, but since we're dealing with time and people like to have negative differences in time, we have to continue to use signed integers.

So . . . what's going to happen roughly 30 years from now? What will happen if software development hasn't transitioned to a 64-bit or 128-bit platform *completely*? Well, we're going to have a LOT of problems. The biggest problem is that we're going to start running across this as a problem in as little as 10-15 years because while internal timeclocks will still work fine until they reach that timestamp of 2038-01-18 21:14:07, anything that references times further into the future cannot use time_t if they want to do so, which really complicates things a lot.

So what do you think about the 2038-01-18 21:14:08 issue? Had you ever heard about it before?

Note: This will only affect programming languages that use 32-bit signed integers for storing their time_t values (PHP, C++, C#, etc). The full list is likely to be exceedingly long, but PHP and the C-based languages are the only ones that I know for sure that this affects.

5.0 stars
Forward

1 month, 2 weeks ago by Michael O. - Pro!

1 Reply

Join Now to Reply!

To add your own reply, sign in or join Pownce today!

1274 Recipients

View all

This note is viewable by everyone.