Filter data based on date and time in gmail imap

I extracted details from my gmail to excel using imap
I wanted to extract data from gmail of a specific timeframe , for example from 27th July 6:30 pm to 28th July 3:30 am.
But Iam not able to.
I am using this but it doesn’t work.

item.Headers(“Date”)>“Mon, 27 Jul 2020 18:30:00 +0530” AND item.Headers(“Date”)<=“Tue, 28 Jul 2020 3:30:00 +0530”
Please help me out.
Thanks!

1 Like