Go to Pay4Bugs.com

The Pay4Bugs Blog

Pay4Bugs is the original pay per bug software testing marketplace. Our testers seek out and report problems with your software or website before they cause you to lose sales and customers.

A bug 40 years in the making - iPod Touch, TimeStamps, and 1970.

Posted by C.S. Hsia on · Comments

Since we're in the business of debugging, we'll frequently share interesting bugs and glitches that we personally encountered. Some of these are truly mind boggling.

When you first become a programmer, you're taught the intricate nature of code, especially the measure of time. Time is not a fixed value, but rather a constant calculation of elapsed time since when the computer first started counting.

How professors taught us to read time.

However with modern day object oriented programming, most of these details are hidden out of site with classes and libraries. With abstraction, comes laziness.

The situation is even more drastic when programming for modern day gadgets, running advanced "smart" Operating Systems. With these devices, we tend to take even more things for granted. Coding is done under the assumption that Apple and Google are right..... most of the time.

Which is what troubled me for days, trying to figure out why a program would work on my iPhone 4, on the office iPhone 3GS, with the iPad, even with the cellar data turned off. Yet certain elements of the app simply refused to work on the iPod Touch.

That was until a sharp eyed colleague looked at my logs, and asked "why are you testing in 1970?" BINGO! that was the problem. (again, why Pay4Bugs believes 3rd person testing is sometimes more efficient than the designers pulling his hair out)

As it turns out, all iOS devices are shipped with the starting system time of January 1st, 1970. Unix time, understandably as iOS is based on a flavor of Unix. Devices with cellular data will sync the time automatically, but iPod touches do not have such feature, and many devices are probably stuck on 1970 time. After spending 20 seconds to set the time to 2011, the App functioned flawlessly.

This clock is 40 years late.

Therefore if you're programming an iPhone App that has intricate use of time stamps, be extra careful for iPod Touch users who might be still living on 1970 time. You can either code for these exceptions, or kindly remind the user that the clock needs to be set forward a good 40 years. (an excellent public service, other App makers will surely thank you for this)