• 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
Question about NSLocale with NSDateFormatter
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Question about NSLocale with NSDateFormatter


  • Subject: Question about NSLocale with NSDateFormatter
  • From: Daniel Mischler <email@hidden>
  • Date: Fri, 11 Nov 2005 00:34:16 +0100

I try to format a date using a locale which does not have to be the user's locale.

In order to get something like "Freitag, 11. November 2005" I tried the following:

NSDateFormatter* _formatter = [[NSDateFormatter alloc] initWithDateFormat:@"%A, %e. %B %Y" allowNaturalLanguage:NO];
[_formatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"de_CH"]];
NSLog(@"%@", [_formatter stringFromDate:[NSDate date]]);


The result is always: "Friday, 11. November 2005".

Where are things going wrong? Couldn't find anything in the documentation that helped. Tried it with other locale identifiers too.

Thanks for your help

Daniel


______________________________________________________________________

amazing technologies
Chamerstrasse 56               phone: +41 41 7 123 654
6300 Zug                       email: email@hidden

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Question about NSLocale with NSDateFormatter
      • From: mmalcolm crawford <email@hidden>
    • Re: Question about NSLocale with NSDateFormatter
      • From: Rob Mayoff <email@hidden>
  • Prev by Date: Re: NSLock locking order;
  • Next by Date: Re: Custom NSView and NSUndoManager SOLVED
  • Previous by thread: Re: (id)sender tag
  • Next by thread: Re: Question about NSLocale with NSDateFormatter
  • Index(es):
    • Date
    • Thread