Parsing ISO 8601 with NSDateFormatter
I've read through the various posts on SO about this, but have still not solved the problem.
Here's the string that I'm trying to parse into an NSDate object:
I understand that the problem is the time zone format. Here's the date format string that I'm trying:
Thanks for any help.
Use the -[NSDateFormatter getObjectValue:forString:range:error:] method to learn how much of the string was parsed and what error prevented parsing further.
The ZZZZ format string corresponds to something like "GMT+02:00", with that "GMT" in there. You may need to inject that into the string you're parsing for it to work.
Apple's Data Formatting Guide advises "Consider Unix Functions for Fixed-Format, Unlocalized Dates".
Now the dedicated NSISO8601DateFormatter is available.