I have a .NET REST service which returns data in JSON format. One field is date time in UTC which looks like this:
"Synced":"2012-07-11T13:28:42.967"
I am tring to get this date in my iOS application, but every time I try I get null:
NSDateFormatter *dateFormatter = [NSDateFormatter new];
[dateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ssZ"];
dateFormatter.timeZone = [NSTimeZone timeZoneWithAbbreviation:@"UTC"];
NSArray *dateFormatters = [[NSArray alloc]initWithObjects:dateFormatter, nil];
[RKObjectMapping setDefaultDateFormatters:dateFormatters];
What I am doing wrong? Thanks!
try this: