I'm having some issues trying to format a string into NSDate. This is my code.
NSTimeZone *outputTimeZone = [NSTimeZone defaultTimeZone];
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setTimeZone:outputTimeZone];
[dateFormat setLocale:[NSLocale currentLocale]] ;
[dateFormat setDateFormat:@"dd/MM/yyyy HH:mm:ss"];
NSDate *myDate = [dateFormat dateFromString:dateString];
this is the string that I'm trying to format.
"09/11/2016 12:27:05"
this is the result I get
2016-11-09 04:48:29 UTC
Please help I have been trying various solutions and formats but to no avail.
After the call to dateFromString, add the line NSLog("str = %@, date = %@", dateString, myDate);. Update your question with the output of that log statement. – rmaddy 59 mins ago
This is my output
str = 09/11/2016 14:13:35, date = 2016-11-09 06:13:35 +0000