I compare two dates with compare method .When I'm using date formatter as sedate style it return right answer.If I'm set the date formatter in custom way ;the answer was wrong.Isn't possible to compare two dates with custom formatter in iOS?
Asked
Active
Viewed 188 times
1
-
1Formatting dates (i.e. `NSString` <=> `NSDate`) and comparing dates are two entirely different things. – trojanfoe Sep 18 '13 at 10:36
-
1Why don't you compare dates without formatter? – Sviatoslav Yakymiv Sep 18 '13 at 10:36
-
1you can follow this [link][1]. This types of questions are already asked. [1]: http://stackoverflow.com/questions/6112075/ios-compare-two-dates – Bhrigesh Sep 18 '13 at 10:42
2 Answers
2
if ([date1 isEqualToDate:date2]) {
}
This is the simple way to Compare two dates...

Simon
- 25,468
- 44
- 152
- 266

mani murugan
- 213
- 2
- 12