How to convert MySQL datetime to NSDate?
MySQL returns this datetime: 2014-05-07T16:58:44.000Z How, with what datetime format I can create NSDate ? I far as I found this, but it does not work: NSDateFormatter *df = [[NSDateFormatter alloc] init]; [df setDateFormat:@"yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'"]; NSDate *date = [df dateFromString: valueStr]; Your format string is close, but you want to specify the milliseconds with SSS , too: [df setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss.SSSX"]; Also, the Z in your date string stands for "Zulu" (i.e. GMT/UTC), so your dateFormat should use Z or X without quotes so that it correctly parses the string