Skip navigation.
 
mlRe: NSDateFormatter -- accepting different formats at runtime
FROM : Jens Alfke
DATE : Mon Jun 23 23:29:52 2008

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_removed>)

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:
http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>

This email sent to <email_removed>

Related mailsAuthorDate
mlNSDateFormatter -- accepting different formats at runtime Daniel Richman Jun 23, 23:24
mlRe: NSDateFormatter -- accepting different formats at runtime Jens Alfke Jun 23, 23:29