Re: If date is greater than
| From: | John Taylor-Johnston | Date: | Sun, 20 Oct 2013 03:33:35 +0000 |
| Subject: | Re: If date is greater than | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-322330@lists.php.net to get a copy of this message | ||
This works for dates after 2011-11-01 but is not stopping after 2012-12-31.
What is wrong with my if statement?
$meetingdate=strtotime($mydata->meetingdate);
$date1=strtotime("2011-11-01");
$date2=strtotime("2012-12-31");
if (($meetingdate >= $date1) and ($meetingtime <= $date2))
{
$mydata->meetingdate
}
John Taylor-Johnston wrote:
I have date strings in my mysql db. yyyy-mm-dd.
I want to parse to see if the date is greater than november 2011 and less than december 2012.
Is this the right approach? How bad is my syntax?
|function dates_range($todaynow)
{ |
|$date1=strtotime("2011-11-01");
$date2=strtotime("2012-12-31");
if (|||($|||||todaynow |>= $date1) and |||||($|||||||todaynow| <= $date2)||)
|| {
|| # do something
|||| }
}
|||