Change startTime and endTime to Interval