Examples
import numpy as np
import pandas as pd
i = pd.date_range('2019-04-09', periods=4, freq='1D20min')
ts = pd.DataFrame({'P': [2, 3, 4, 5]}, index=i)
ts
ts.between_time('0:15', '0:40')
You get the times that are not between two times by setting start_time later
and end_time:
ts.between_time('0:40', '0:15')