On Jun 18, 2010, at 9:19 PM, Rick Mann wrote:

> On Jun 18, 2010, at 21:15:58, David Rowland wrote:
> 
>> 
>> On Jun 18, 2010, at 6:38 PM, Rick Mann wrote:
>> 
>>> iPhone
>>> 
>>> Hi. I need to display the time zone in which a particular time is 
>>> displayed. The time zone is created from its full POSIX name (i.e. 
>>> "Asia/Oral"), but when I ask the NSTimeZone for its abbreviation, I often 
>>> get abbreviations in the form of "GMT+05:00" instead of "RST" (or whatever 
>>> is appropriate for that time zone).
>>> 
>>> Time Zone abbreviations are not unique across the world; that's okay. What 
>>> I want is for a user local to Asia/Oral to see the 2-4 letter abbreviation 
>>> displayed and understand what he's seeing.
>>> 
>>> There is an abbreviation dictionary in iPhone OS, but it goes the wrong 
>>> way. It uses the abbreviations as keys, and the POSIX names as values. But 
>>> POSIX names are unique, while abbreviations are not, so this is a very 
>>> US-centric dictionary.
>>> 
>>> Is there any way to get short abbreviations for a TimeZone? I need it short 
>>> due to limited space. I need a common abbreviation due to users not knowing 
>>> POSIX timezone names.
>> 
>> this works for me:
>> 
>> NSTimeZone* theZone;
>> NSString* zoneAbbreviation;
>> 
>> theZone = [NSTimeZone timeZoneWithName:tzName];
>> zoneAbbreviation = [theZone abbreviation];
>> 
> 
> I've discovered that this seems to be a change between iOS 3.1/3.2 and 4.0.
> 
> That is, the code works, but does not return the correct values.

If it doesn't return the correct values then it doesn't work. I have not used 
4.0 yet, so this goes high on my watch list.

_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to