best practice to obtain time zone for iPhone vs iPod Touch

Posted by johnbdh on Stack Overflow See other posts from Stack Overflow or by johnbdh
Published on 2010-04-10T07:47:13Z Indexed on 2010/04/10 7:53 UTC
Read the original article Hit count: 319

Filed under:
|
|
|

I am creating an app that requires the users current time zone. If the device being used is an iPhone and the user has their Time Zone set to automatically change, I think I can be fairly confident that localTimeZone or systemTimezone will give me the correct time zone for the user's location.

If on the other hand the device is an iPod Touch, the time zone returned by localTimeZone and systemTimeZone appears to always be whatever time zone is set in the Date & Time settings, regardless of the user's actual location. I tried using location services but, while the lat/long is being provided properly, the time zone offset in the timesStamp I am getting is always the same as whatever the user has set for their time zone setting.

Any suggestions?

John

© Stack Overflow or respective owner

Related posts about iphone

Related posts about xcode