entry1 = time[1] < timestamp(2019,9,4,6,00) and time >= timestamp(2019,9,4,6,00) exit1 = time[1] < timestamp(2019,9,4,9,00) and time >= timestamp(2019,9,4,9,00) entry2 = time[1] < timestamp(2019,9,4,12,00) and time >= timestamp(2019,9,4,12,00) diff = time - time[1]