• 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
Converting non-English date string to NSDate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Converting non-English date string to NSDate


  • Subject: Converting non-English date string to NSDate
  • From: Kyle <email@hidden>
  • Date: Tue, 31 Mar 2009 12:33:41 -0700

My app imports tab-delimited data, and to convert a string date value to a NSDate value, it uses this method:

NSDate *theDate = [NSDate dateWithNaturalLanguageString:theStr
locale:[[NSUserDefaults standardUserDefaults] dictionaryRepresentation]];


This works fine for English date strings, but not when the date string is non-English. For example, a German date string usually (but not always) returns a nil value. This is true even when the OS is the German OS.

Is there better way to convert string date values to NSDate values, especially non-English string date values?

Thanks in advance.
-Kyle
_______________________________________________

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: Converting non-English date string to NSDate
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: custom toolbar item autoresizing?
  • Next by Date: Re: custom toolbar item autoresizing?
  • Previous by thread: Re: custom toolbar item autoresizing?
  • Next by thread: Re: Converting non-English date string to NSDate
  • Index(es):
    • Date
    • Thread