Best Practice to Get Time Zone for iPhone vs iPod Touch
I am creating an application that requires the users' current timezone. If the device being used is an iPhone and the user has their timezone to change automatically, I think I can be reasonably sure that localTimeZone or systemTimezone will give me the correct timezone for the user's location.
If, on the other hand, the device is an iPod Touch, the time zone returned by localTimeZone and systemTimeZone will always be regardless of which time zone is set in the date and time settings, regardless of the user's actual location. I've tried using location services, but while the lat / long is provided as expected, the timezone offset in the timeStamp I get is always the same as what the user has set to set their timezone.
Any suggestions?
John
source to share
you can use the method locaTimeZone
fromNSTimeZone
NSTimeZone *timeZone = [NSTimeZone localTimeZone];
here is our company's fav fruit example -> http://developer.apple.com/library/mac/#samplecode/PhotoSearch/Listings/DateCell_m.html%23//apple_ref/doc/uid/DTS10003994-DateCell_m-DontLinkElementID_7
source to share
Not unless you roll yourself. The only real option is to use CoreLocation to determine where you are in the world, figure out the name of the timezone you are in and then find the NSTimeZone based on that name .... but I don't even think CoreLocation is available on the iPod Touch (I could be wrong).
source to share