You need two formats, because fractional seconds are optional, and the time zone should be Z5, not Z. Thus, you create two formats with formats
@"yyyy'-'MM'-'dd'T'HH':'mm':'ssX5" @"yyyy'-'MM'-'dd'T'HH':'mm':'ss.SSSSSSX5"
and try both of them. This is obvious to RFC3339; Your lines may not be in this format. Glad you did not ask RFC822 what it hurts to do right. But first you must have a method that returns NSDate, because most applications do not actually need a string formatted for the user.
source share