views:

57

answers:

3

My app hit the app store today. I had a user submit a weird bug. I have a date picker that passes back a date that I store as a string in SQLite. I tested the app on the simulator, a 3G, a itouch, and an iPAD. On all of these, it works as expected. However, on this user's 3GS it adds a day to the date selected in the date picker.

I am not doing any manipulation with the date other than using an NSDateformatter with NSDateFormatterMediumStyle style to convert to a string to store in the db.

Any ideas why this would work differently on the 3GS?

A: 

This sounds like a timezone issue rather than an issue with the 3GS.

I am not sure if this is true with the NSDateformatter (i'll try it out), but if you get description property of the NSDate, you will get a local time (with GMT offset).

If you are persisting these local time strings and then de-persisting them assuming GMT (or if the timezone on the device changed) then the times are going to be wrong. Check what timezone the user is in and try testing with your system timezone set accordingly (Simulator will use the MacOS timezone).

Cannonade
A: 

Check that you're setting the NSLocale on any date formatters and date scanners. By default, they use the user's locale, which might be different if they've set it to something other than your locale.

lucius