Reputation: 9935
I might missing something, but I can't compose proper date formatter string for the date:
2016-01-14T10:24:26+0000
What is 'T' here? and how to include timezone?
My string does not work: @"yyyy-MM-dd'T'hh:mm:ss Z"
Upvotes: 1
Views: 127
Reputation: 910
NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init];
dateFormatter.dateFormat = @"yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'";
NSDate *yourDate = [dateFormatter dateFromString:myString];
Upvotes: 0
Reputation: 629
You have to use 'T' in single quotes like below format to retrive string ftom date:
yyyy-MM-dd'T'hh:mm:ssZ
Let me know.
Upvotes: 3