NSDateFormatter does not support ISO8601

Originator:ajpike
Number:rdar://9512398 Date Originated:26-May-2011 05:56 PM
Status:Open Resolved:
Product:Developer Tools Product Version:
Classification: Reproducible:Always
 
Summary: Dates in the form 2011-05-25T22:56:03+00:00 cannot be parsed using NSDateFormatter, specifically the time zone section. You can parse time zones like "GMT+00:00" and time zones like "+0000" but not "+00:00".

Steps to Reproduce: Try to parse a date generated by MySQL on iOS.

Expected Results: You can somehow parse a date in this format.

Actual Results: This is not possible using NSDateFormatter.

Notes: A lot of people suggest http://boredzo.org/iso8601unparser/ but it's kind of silly to add 3rd party code to your project for something so common. Also, reportedly, this code is very slow.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!