I am having Date like "payment_date" = "03:12:00 May 06, 2014 MDT";
.
But i want to convert this data into NSDate
like "06-05-2014"
Please help me, don't know to handle it..
i got the answer from Converting NSString to NSDate (and back again)
__block NSDate *detectedDate;
//Detect.
NSDataDetector *detector = [NSDataDetector dataDetectorWithTypes:NSTextCheckingAllTypes error:nil];
[detector enumerateMatchesInString:t_date
options:kNilOptions
range:NSMakeRange(0, [t_date length])
usingBlock:^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop)
{ detectedDate = result.date;
NSDate *d=result.date;
}
];