I'm trying to convert an NSString to NSDate. My incoming string is 02/03/2015 my converting is done like this:
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
dateFormat.locale = [NSLocale currentLocale];
dateFormat.timeZone = [NSTimeZone localTimeZone];
dateFormat.timeStyle = NSDateFormatterShortStyle;
dateFormat.dateStyle = NSDateFormatterShortStyle;
dateFormat.locale = [NSLocale currentLocale];
[dateFormat setDateFormat:@"dd/MM/yyyy"];
NSDate *date = [dateFormat dateFromString:jsonObject[@"chartDate"]];
My ouput is: "2015-03-01 23:00:00 +0000" So suddenly the date is one day back (this is retrieved from Coredata, where it is a NSDate).
Can someone explain me whats wrong?