Re: NSDateFormatter and time
Re: NSDateFormatter and time
- Subject: Re: NSDateFormatter and time
- From: Jerry Krinock <email@hidden>
- Date: Fri, 29 Jun 2007 16:51:25 -0700
On 2007 Jun, 29, at 16:33, Greg Hoover wrote:
I've read that the NSDateFormatter is pretty buggy, but it seems
that this trivial bit of code should work...
<snip></snip>
All I get as a response in null. Am I missing something, or is
NSDateFormatter really this bad?
It's not buggy, it's just got a few million years to evolve before it
is as smart as you are. Reverse engineer it. Maybe it doesn't like
the lower-case "pm" or some silly thing.
As an alternative, though, I just tried -[NSDate
dateWithNaturalLanguageString:] on your string, and it worked
perfectly. The docs say that Apple doesn't recommend -
dateWithNaturalLanguageString, but it was improved in Tiger vs.
Panther. If you have to deal with date strings in sloppy formats, it
might be your best bet because I'm sure they worked on it for more
than a day or two. As always, though, "Check for nil!"
_______________________________________________
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