//日期NSDate比较
-(NSInteger)compareDate:(NSDate*)date01withDate:(NSDate*)date02{
NSInteger co;
NSComparisonResult result = [date01 compare:date02];
switch(result)
{
//date02比date01大
case NSOrderedAscending: co=1; break;
//date02比date01小
case NSOrderedDescending: co=-1; break;
//date02=date01
case NSOrderedSame: co=0;break;
default:NSLog(@"erorr dates %@, %@", date02, date01);break;
}
return co;
}