This is what I am trying for getting date from the string 2016-10-20T13:01:47.317 but getting nil
NSDateFormatter *dateFormatter1 =
Try this for remove millisecond :
NSString *dateString = @"your string";
NSDateFormatter* dateFormatter1 = [[NSDateFormatter alloc] init];
dateFormatter1.dateFormat = @"YYYY-MM-ddTHH:mm:ss.SSS";
NSDate *yourDate = [dateFormatter1 dateFromString:dateString];
dateFormatter1.dateFormat = @"YYYY-MM-ddTHH:mm:ss";
NSLog(@"%@",[dateFormatter1 stringFromDate:yourDate]);