Re: Getting time zone abbreviations
Re: Getting time zone abbreviations
- Subject: Re: Getting time zone abbreviations
- From: Rick Mann <email@hidden>
- Date: Fri, 18 Jun 2010 21:36:45 -0700
On Jun 18, 2010, at 21:34:30, David Rowland wrote:
>>>>> On Jun 18, 2010, at 6:38 PM, Rick Mann wrote:
>>>>>> 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.
>>
>> Well, the values are correct in that some time zones return correct abbreviations like PDT, and other time zones return "GMT±HH:MM", depending on the time zone.
>>
>> Interestingly,
>>
>> NSTimeZone* tz = [NSTimeZone timeZoneWithName: @"UTC"];
>> NSString* abv = tz.abbreviation;
>>
>> returns "GMT+00:00". Not very nice.
>
> A step backwards. I would report it as a bug, but I don't yet use 4.0. I suggest you report it.
Already did._______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden