title: how to get all products between two dates?
body: <p>how to get all products between two dates like last month products, this month products , last week products and this week products etc.</p>
  
  <p>i tried with this:</p>
  
  <pre><code>// current day to start with
  $start = mktime(0,0,0,date('m'), date('d'), date('Y'));;
  
  // calculate the first day of last month
  $first = date('YYYY-MM-DD',mktime(0,0,0,date('m',$start) - 1,1,date('Y',$start)));
  
  // calculate the last day of last month
  $last = date('YYYY-MM-DD',mktime(0, 0, 0, date('m') -1 + 1, 0, date('Y',$start)));
  
  
  
     if($filter == "lastmonth"){
  
      $collection = Mage::getModel('catalog/product')-&gt;getCollection();
      $collection-&gt;addAttributeToFilter('updated_at', array('gteq' =&gt;$first));
      $collection-&gt;addAttributeToFilter('updated_at', array('lteq' =&gt; $last));
  
  
  }
  </code></pre>
  
  <p>but i am not able to get the result :( any help ?</p>
  
  <p><strong>Modified after Daniel response !</strong></p>