我需要计算时差 24Hrs Time。代码中的某些地方似乎有问题
if ( shiftToMin >= shiftFromMin ){
shiftTotalMin = shiftToMin - shiftFromMin;
if( shiftFromHr < shiftToHr ){
shiftTotalHr = shiftToHr - shiftFromHr;
}else{
shiftTotalHr = ( 24 - shiftFromHr ) + shiftToHr;
}
}else{
shiftTotalMin = 60 - ( shiftFromMin - shiftToMin );
if( shiftFromHr < shiftToHr){
shiftTotalHr = ShiftToHr - shiftFromHr;
}else{
shiftTotalHr = ( 24 - shiftFromHr ) + shiftToHr;
}
shiftTotalHr = shiftTotalHr - 1;
}