• 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: On iOS5 simulator and device, NSDateFormatter doesn't show time zone abbreviation for "Asia/Kolkata" for the "z" or "zzz" specifier.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: On iOS5 simulator and device, NSDateFormatter doesn't show time zone abbreviation for "Asia/Kolkata" for the "z" or "zzz" specifier.


  • Subject: Re: On iOS5 simulator and device, NSDateFormatter doesn't show time zone abbreviation for "Asia/Kolkata" for the "z" or "zzz" specifier.
  • From: Kyle Sluder <email@hidden>
  • Date: Tue, 31 Jan 2012 11:06:08 -0800

On Tue, Jan 31, 2012 at 10:37 AM, Heath Borders <email@hidden> wrote:
> On iOS5 simulator and device, NSDateFormatter doesn't show time zone
> abbreviation for "Asia/Kolkata" for the "z" or "zzz" specifier.
>
> NSTimeZone *timeZone = [NSTimeZone timeZoneWithName:@"Asia/Kolkata"];
> NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
> dateFormatter.dateFormat = @"z"; // or @"zzz"
> dateFormatter.timeZone = timeZone;
>
> NSLog(@"date string: %@", [dateFormatter stringFromDate:[NSDate
> date]]); // "GMT+05:30", expected "IST"
> NSLog(@"time zone abbreviation: %@", [timeZone
> abbreviationForDate:[NSDate date]]); // "IST"
>
> I expect the above code to output
>
> IST
> IST
>
> but it outputs
>
> GMT+05:30
> IST

What's the current locale? IIRC only "expected" abbreviations are
substituted, since they can be ambiguous.

--Kyle Sluder
_______________________________________________

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


References: 
 >On iOS5 simulator and device, NSDateFormatter doesn't show time zone abbreviation for "Asia/Kolkata" for the "z" or "zzz" specifier. (From: Heath Borders <email@hidden>)

  • Prev by Date: Re: Update of Typography panel
  • Next by Date: Calling an Objective-C function from C++?
  • Previous by thread: On iOS5 simulator and device, NSDateFormatter doesn't show time zone abbreviation for "Asia/Kolkata" for the "z" or "zzz" specifier.
  • Next by thread: Calling an Objective-C function from C++?
  • Index(es):
    • Date
    • Thread