Re: NSDateFormatter -- accepting different formats at runtime
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