I have two MyDate
objects.
class MyDate {
public int hours, minutes;
MyDate(int hours, int minutes) {
this.hours = hours;
this.minutes = minutes;
}
}
MyDate startTime;
MyDate endTime;
and i have a timestamp as a third MyDate object.
MyDate currentTime;
I want to know is currentTimeStamp included or not in interval endDate - startDate
[------------[startTime]------------[currentTime]-----------------[endTime]--------------]
I see three combinations of time :
- 23:00 - 08:00 (07:00 - true)
- 12:00 - 13:00 (07:00 - false)
- 23:59 - 23:58 (07:00 - true)
Explain third case :
[-----------------(23:59)(00:00 - new Day)--(07:00)----------(23:58)--(00:00 - new Day)]
How i can check is currentTimeStamp included or not in interval endDate - startDate?