Possible Duplicate:
How to compare two dates in Objective-C
I'd like to pop up a message in one of my apps when the date is in the range of two dates (e.g. the holiday period)
So like
if(dateInRangeof:date1, date2){True}else{false}
Looking for any code snippets or apis to look at. Cheers
- (BOOL)isDate:(NSDate *)date inRangeFirstDate:(NSDate *)firstDate lastDate:(NSDate *)lastDate {
return [date compare:firstDate] == NSOrderedDescending &&
[date compare:lastDate] == NSOrderedAscending;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With