Jump to content

Select By today's date


Nexy

Recommended Posts

provided you have the date in raw format(strtotime format), you can do either..

 

I have a get_midnight function which basically gets the day today and calculates the exact second that midght today hit and then I do a query for everything with a date greater than that value. That'd give you everthing that was done today.

 

Hope that helped  :)

 

 

 

Edit: here's the get_midnight function..

 

function get_midnight($timestamp)

{

  $day = date("j", $timestamp);

  $month = date("F", $timestamp);

  $year = date("Y", $timestamp);

 

  $midnight = strtotime("$month $day $year");

 

  return $midnight;

}

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.