使用日期使用php和imap通过电子邮件搜索gmail

from gmail using PHP imap i need get all yesterday's emails. My code:

$emails = imap_search($inbox, 'FROM "mytestemail@gmail.com" ON "2013-11-24"');

Everything seems simple and clear, but with a 24-day email i also get and several (1-3) emails from 25 days. Same as if trying to look 22, 21 d. ...

Why gmail adds several letters from the next day?

IMAP's date search isn't quite precise. There are timezone issues. The messages from the 25th are probably from the first hours after midnight, when it was still the 24th somewhere. You may also get messages from the 23rd, from locations where it was the 24th already.

Whether this is a bug or not depends on what you want the search to do.

I don't remember whether all IMAP servers behave in exactly the same way.