-1

@"2019-12-27T06:42:35Z" app crash when stringDate convert into date

NSDateFormatter*dateFormat = [[NSDateFormatter alloc] init];
    [dateFormat setDateFormat:@"yyyy-MM-dd HH:mm:ss Z"];

NSDate*date = [dateFormat dateFromString:sentDate];
    return  date;
Desdenova
  • 5,326
  • 8
  • 37
  • 45

1 Answers1

0

The date format you are providing to your date formatter is wrong. So as per your input, your date format should be yyyy-MM-dd'T'HH:mm:ssZ

Rameez
  • 412
  • 1
  • 5
  • 16