I have dates inside strings with this format:
2014-02-05T23:09:19.642Z
2014-02-05T23:09:54.645Z
...
I've tried to parse them to NSDate doing the following:
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ssZ"];
NSDate *date = [formatter dateFromString:dateString];
But date is ending up being null, so how this needs to be done?
I tried with:
[formatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss.sssZ"];
And it works for
2014-02-05T23:13:51.000Z
But not with:
2014-02-05T23:23:44.420Z
2014-02-05T23:01:19.620Z
...