Facebook Races To Fix ’46 Years Of Friendship’ Notification Bug That Has Unix Roots

You never know what a new year will bring. Sometimes the thought is scary, like the unwarranted Y2K panic that had people preparing for the end of the world. And this year? The turn of the calendar caused Facebook to wig out and send notifications to several users congratulating them on "46 years of friendship" on the social network.

Maybe you have been friends with someone since 1969, but it hasn't been that long on Facebook. That's because it didn't exist 46 years ago. It didn't even exist 12 years ago. Heck, the Internet wasn't a ubiquitous thing back then, yet Facebook woke up this morning and decided to rewrite history. What exactly happened?

"We've identified this bug and the team's fixing it now so everyone can ring in 2016 feeling young again," Facebook said in a statement.

Unix

We could have surmised on our own that it was a glitch of some sort, it's the cause of the bug that's a mystery. Mark Davis, an engineer for Microsoft, may have solved it. Here's what he wrote on his Facebook page.

I was amused as anyone else when Facebook celebrated my 46 years of friendship with someone this morning. Naturally, the inner nerd in me can’t just take at face value–to those of you unaware, the Unix Epoch (aka the date that has an internal value of ‘0’ on a Unix system) is 1/1/1970, which based on time zone adjustments, can become a random hour on 12/31/1969. Which is 46 years ago today.

Now, you might be wondering, so what? Why is it in my Facebook feed? Well, if you click on your “memories” page, you’ll see a subset of you friends listed as having a 46 year old Facebook memory today. Scrolling through my list, it’s the people I’ve been friends with on Facebook for a very long time – chances are, the “friends with since” feature was implemented AFTER I became friends with those people. And as such, it’s stored in the database as ‘0’ rather than the actual date. The developer who wrote the “friends with since” memories algorithm should have added a case ‘WHERE friendsWithSinceDate != ‘0” or something along those lines. But they didn’t so those people appear in today’s query.
Unix, which is the core of Apple's Mac OS X, keeps time by counting up seconds indefinitely, starting at January 1, 1970, at midnight Greenwich Mean Time, otherwise known as the Unix Epoch. All dates and time are relative to the Unix Epoch, though coding errors can throw off the calculations.

And there you go, some fun trivia fodder for 2016!