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
I understand that the problem is the time zone format. Here’s the date format string that I’m trying:
Thanks for any help.
- UITextView text cut off when there is a large amount of text
- How to resize a UIModalPresentationFormSheet?
- AFnetworking downloading multiple files
- Regular / Regular position sizing constraints for all iPads, including iPad pro?
- Custom Xcode IDE Plugin error: “Could not find class named…”
- How do you select uitableview rows programmatically
2 Solutions Collect From Internet About “Parsing ISO 8601 with NSDateFormatter”
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.
- iOS “ current graphics context” – What is that
- Difficulty implementing NSUndoManager redo function
- How to get the message delivary status using XMPP framework
- Core Data memory usage and Memory Warning
- Dynamic Type and Self-Sizing Cells with Static Table
- How to set tcp_nodelay in GCDAsyncsocket?
- ARC with blocks and retain cycles
- Swift – New Update gives optional issues
- A server with the specified hostname could not be found
- update text field ui in swift ios
- How do you debug an issue with a release mode build in iOS?
- Does a NSURLConnection retain its delegate?
- Not working transitions in SpriteKit
- How can I add a link for a rate button with swift?
- How can I find a number of True statements in an Array of Bools in Swift