• 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: NSDateFormatter -- accepting different formats at runtime
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDateFormatter -- accepting different formats at runtime


  • Subject: Re: NSDateFormatter -- accepting different formats at runtime
  • From: Jens Alfke <email@hidden>
  • Date: Mon, 23 Jun 2008 14:29:52 -0700


On 23 Jun '08, at 2:24 PM, Daniel Richman wrote:

I know it is possible to set how the date is formatted at compile time via IB, but is there any way to accept multiple formats at runtime?

The only real way to do this is to create a number of NSDateFormatters, each with a different format string, and try to parse your date string with each one in turn. (That's what Apple's RSS- parsing frameworks had to do, to support all the 'creative' misuses of date formats in real-world news feeds.)


—Jens_______________________________________________

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: 
 >NSDateFormatter -- accepting different formats at runtime (From: Daniel Richman <email@hidden>)

  • Prev by Date: Re: Learning SQLite by watching Core Data?
  • Next by Date: Re: Learning SQLite by watching Core Data?
  • Previous by thread: NSDateFormatter -- accepting different formats at runtime
  • Next by thread: Cocoa Text System: How to determine the caret position?
  • Index(es):
    • Date
    • Thread