期間の交差

	//四种情况  inAll   outAll   比较时间       startTime   endTime 标准时间
			if(outAll>inAll){// 顺时无跨晚上12点
			  if(startTime> endTime){//标准跨晚上12点
			    if(outAll>startTime || inAll<endTime){
			      //有交集
			    }
			  }else{
			    if((outAll < startTime  && inAll < startTime ) || (endTime < outAll && endTime < inAll)){
			      // "无交集"
			    }else{
			     //有交集
			    }
			  }
			
			}else{//跨晚上12点

			  if(startTime> endTime){//标准晚上12点    都跨12点必然有交集
			    //有交集
			  }else{
			    if(inAll<endTime|| outAll> startTime){
			      //有交集
			    }
			  }
			
			}

おすすめ

転載: blog.csdn.net/hmily43/article/details/129316570
おすすめ