I have the start time and end time in formats HH:mm:ss (24-hour).
I need to compare if the current time is between the start and end time.
I have coded the logic in such a way that it will add 24 hrs to the start time if start time is later than the end time.
if (shift.sShiftStart < shift.sShiftEnd) {
startTime = shift.sShiftStart;
startTimeInt = [[shift.sShiftStart substringToIndex:2] integerValue];
startTimeInt2 = startTimeInt + 24;
finalStartTime = [startTime stringByReplacingCharactersInRange:NSMakeRange(0, 2) withString:[NSString stringWithFormat:@"%d", startTimeInt2]];
} else {
finalStartTime = shift.sShiftStart;
}
Now I want to check if my currentTime is between finalStartTime and endTime (all are in HH:mm:ss formats)