1

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?

Albin Joseph
  • 1,133
  • 15
  • 27

2 Answers2

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
1
You can try this    

 if ([date1 compare:date2]==NSOrderedSame)
{
}
Kalpit Gajera
  • 2,475
  • 1
  • 14
  • 24