• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Getting time zone abbreviations
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting time zone abbreviations


  • Subject: Re: Getting time zone abbreviations
  • From: David Rowland <email@hidden>
  • Date: Fri, 18 Jun 2010 21:34:30 -0700

>>>> 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.


_______________________________________________

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

  • Follow-Ups:
    • Re: Getting time zone abbreviations
      • From: Rick Mann <email@hidden>
References: 
 >Getting time zone abbreviations (From: Rick Mann <email@hidden>)
 >Re: Getting time zone abbreviations (From: David Rowland <email@hidden>)
 >Re: Getting time zone abbreviations (From: Rick Mann <email@hidden>)
 >Re: Getting time zone abbreviations (From: David Rowland <email@hidden>)
 >Re: Getting time zone abbreviations (From: Rick Mann <email@hidden>)

  • Prev by Date: Re: Getting time zone abbreviations
  • Next by Date: Re: Getting time zone abbreviations
  • Previous by thread: Re: Getting time zone abbreviations
  • Next by thread: Re: Getting time zone abbreviations
  • Index(es):
    • Date
    • Thread