Custom Code: Retrieve IMAP email based on date AND time

Hi All,

I’m trying to retrieve email using IMAP that’s less than a certain number of hours old.
I already looked into the mailkit and mimekit but it won’t work with gmail.
So After looking I go too know that we can do that using RFC5032 https://tools.ietf.org/html/rfc5032 but I don’t know how to use it.
Please help me if anyone know about this.
Currently I am using this code.
var query = SearchQuery.DeliveredAfter(DateTime.Today.AddHours(-1));
foreach (var uid in inbox.Search(query))
{
var message = inbox.GetMessage(uid);

                Console.WriteLine("[match] {0}: {1} {2}", uid, message.Subject, message.Date);
            }

Thanks!
Anmol