How about this?
from dateutil import parser
timestamps = [
"2021-03-19 07:20:00.923000+00:00",
"2021-03-19 08:20:00.923000+00:00",
"2021-03-19 08:20:02.221000+00:00",
"2021-03-19 08:20:03.485000+00:00",
"2021-03-19 08:20:04.275000+00:00",
"2021-03-19 08:20:05.285000+00:00",
"2021-03-19 08:20:07.876000+00:00",
"2021-03-19 08:20:08.450000+00:00",
"2021-03-19 08:20:08.806000+00:00",
"2021-03-19 09:20:09.680000+00:00",
"2021-03-19 09:20:09.699000+00:00",
"2021-03-19 09:20:11.081000+00:00",
"2021-03-19 10:20:11.081000+00:00",
]
print("\n".join(t for t in timestamps if parser.parse(t).time().strftime("%H:%M") in ["08:20", "09:20"]))
Output:
2021-03-19 08:20:00.923000+00:00
2021-03-19 08:20:02.221000+00:00
2021-03-19 08:20:03.485000+00:00
2021-03-19 08:20:04.275000+00:00
2021-03-19 08:20:05.285000+00:00
2021-03-19 08:20:07.876000+00:00
2021-03-19 08:20:08.450000+00:00
2021-03-19 08:20:08.806000+00:00
2021-03-19 09:20:09.680000+00:00
2021-03-19 09:20:09.699000+00:00
2021-03-19 09:20:11.081000+00:00
EDIT:
As pointed out in the comments, if you want to match any time between 08:20 and 09:20 then try this:
from dateutil import parser
timestamps = [
"2021-03-19 07:20:00.923000+00:00",
"2021-03-19 08:20:00.923000+00:00",
"2021-03-19 08:20:02.221000+00:00",
"2021-03-19 08:20:03.485000+00:00",
"2021-03-19 08:20:04.275000+00:00",
"2021-03-19 08:20:05.285000+00:00",
"2021-03-19 08:20:07.876000+00:00",
"2021-03-19 08:21:08.450000+00:00",
"2021-03-19 08:30:08.806000+00:00",
"2021-03-19 08:56:08.806000+00:00",
"2021-03-19 09:09:09.680000+00:00",
"2021-03-19 09:20:09.680000+00:00",
"2021-03-19 09:26:09.699000+00:00",
"2021-03-19 09:58:11.081000+00:00",
"2021-03-19 10:20:11.081000+00:00",
]
print("\n".join(t for t in timestamps if "08:20" <= parser.parse(t).time().strftime("%H:%M") <= "09:20"))
Or a good old for loop if you feel like having one:
for time_ in timestamps:
t = parser.parse(time_).time().strftime("%H:%M")
if "08:20" <= t <= "09:20":
print(time_)
Output:
2021-03-19 08:20:00.923000+00:00
2021-03-19 08:20:02.221000+00:00
2021-03-19 08:20:03.485000+00:00
2021-03-19 08:20:04.275000+00:00
2021-03-19 08:20:05.285000+00:00
2021-03-19 08:20:07.876000+00:00
2021-03-19 08:21:08.450000+00:00
2021-03-19 08:30:08.806000+00:00
2021-03-19 08:56:08.806000+00:00
2021-03-19 09:09:09.680000+00:00
2021-03-19 09:20:09.680000+00:00
2021-03-19 08:20:00.923000+00:00
2021-03-19 08:20:02.221000+00:00
2021-03-19 08:20:03.485000+00:00
2021-03-19 08:20:04.275000+00:00
2021-03-19 08:20:05.285000+00:00
2021-03-19 08:20:07.876000+00:00
2021-03-19 08:21:08.450000+00:00
2021-03-19 08:30:08.806000+00:00
2021-03-19 08:56:08.806000+00:00
2021-03-19 09:09:09.680000+00:00
2021-03-19 09:20:09.680000+00:00