title: How to query mongodb Date using php
body: <p>I need to convert this query from php to mongoDB query</p>
  
  <pre><code>$query = "select * from table where data_added like '%data%';
  </code></pre>
  
  <p>I have date stored in variable</p>
  
  <pre><code>$date = "2013-09-02";
  </code></pre>
  
  <p>and in my mongo Document the date sorted as :</p>
  
  <pre><code>$dateAdded = new MongoDate(strtotime('2013-09-02 12:21:55'));
  </code></pre>
  
  <p>I tried</p>
  
  <pre><code>$date = new MongoDate(strtotime("$date"));
  
  $mongo-&gt;find(array('date_added'=&gt;array('$lt'=&gt;$date)));
  
  and 
  $mongo-&gt;find(array('date_added'=&gt;$date));
  </code></pre>
  
  <p>but without success .</p>
  
  <p>so I need to query usin <strong>(Y-m-d)</strong> not <strong>(Y-m-d h:i:s)</strong>
  so how to use LIKE query for data in mongo</p>
  
  <p>Thanks</p>