I want to compare two dates.For that i have to dates in two strings(fromDates and toDates).
here fromDate is showing the correct value in console.
//Console.
19/12/2012 from date is
After the NSDateFormatter process im getting wrong format and date and sometime it is showing NULL.
//console
First = (null)
I used the below method.
if (fromDate) {
self.printFromDate.text = [NSString stringWithFormat:@"%@",curBtn.dateString];
fromDates = self.printFromDate.text;
NSLog(@"%@ from date is",fromDates);
dtFormatter = [[NSDateFormatter alloc] init];
[dtFormatter setDateFormat:@"yyyy-MM-dd"];
NSDate *strDate = [dtFormatter dateFromString:fromDates];
NSLog(@"First = %@",strDate);
}
Can anyone please tell me where im goin wrong.i completly stuck here.Thanks in advance.