login about faq

Greetings, hope all are fine.. i am trying to go IMAP search on specific time frame.. for example i need to check the main that sent on month jul, so, i use following search criteria:

$objMSGSet = $objIMAP->Search('ALL SINCE "01-Jul-2015" Before "01-Aug-2015"', 1);

and checked the returned email date and noticed the time is as below:

here i gave some example:

m.xxxx@gmail.com = Tue, 30 Jun 2015 18:06:56 GMT
m12xxx6@gmail.com = Tue, 30 Jun 2015 18:16:30 GMT
sc1xxxx4@gmail.com = Wed, 01 Jul 2015 03:58:43 GMT
useoray3xxxxx72@gmail.com = Wed, 01 Jul 2015 03:59:44 GMT

please notice first two items date and time.. it shows jun month result :(

though it was told that IMAP since don't care about time and zone.. but i notice that my gmt is GMT+6.00 and if i add 6 hours it will be 1st JUL

any idea how to get only the message that is send on my since date range?

thanks in advance...

best regards

asked Dec 11 '15 at 06:17

mAlam's gravatar image


As per the IMAP Standard searches are based on the server date

SINCE <date>
         Messages whose internal date (disregarding time and timezone)
         is within or later than the specified date.

So I think the only way around this is the then check the date of the email within your application to remove emails the previous day.

You could also miss emails at the end of your search, eg late on 31st July so you may want to take that into account too.


answered Dec 14 '15 at 07:47

Dempsey's gravatar image


Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Dec 11 '15 at 06:17

Seen: 378 times

Last updated: Dec 14 '15 at 07:47

powered by OSQA