Jump to content

imap_search date format


thompsma

Recommended Posts

I am having a difficult time getting the proper 'date/time' format for the imap_search() function.  I need to search for messages that have arrive in the last 40 minutes.

 

This code DOESN'T work:

 

//setting date/time variables

date_default_timezone_set("America/Los_Angeles"); //setting default timezone

$default_tz = date_default_timezone_get();

$current_date = date("D, j M Y H:i:s"); //current datetime

$my_strtotime = "-40 minutes";

$past_date = date("D, j M Y H:i:s",strtotime($my_strtotime)); //datetime in past

 

//some php code

 

imap_search($mbox,"SINCE \"$past_date\"");

 

//some more php code

 

I have messages in the mailbox that have arrived in the last 40 minutes, but it is still coming up as false.  I was reading that the date/time format is critical, but cannot find what the format should be.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.