title: PHP date comparison to find birthdays that are before timestamp date 1970?
body: <p>I have created function to generate list of members having birthday 1 week before, today and week after. The function is</p>
  
  <pre><code>$m= date("m"); // Month value
          $de= date("d"); //today's date
          $y= date("Y"); // Year value
  
  for($i=0;$i&lt;count($members);$i++){
              $m_bday = strtotime($members[$i]-&gt;dob);
              $bday_date = date('d',$m_bday);
              $bday_month = date('m',$m_bday);
              $bday = strtotime(date('Y-m-d',mktime(0,0,0,$bday_month,$bday_date,$y)));
              //echo $bday_date."&lt;/br&gt;".$bday_month."&lt;/br&gt;".$members[$i]-&gt;dob."&lt;/br&gt;".date('Y-m-d',$bday);exit;
              $week_before = strtotime(date('Y-m-d', mktime(0,0,0,$m,($de-7),$y)));
              $week_after = strtotime(date('Y-m-d', mktime(0,0,0,$m,($de+7),$y)));
  
              if(date('d-m') == date('d-m',$bday)){
                  $this-&gt;present_bday[] = array('mem_name'=&gt; $members[$i]-&gt;name);
              }
              else if(date('d-m',$week_before) &lt;= date('d-m',$bday) &amp;&amp; date('d-m',$bday) &lt; date('d-m')){
                  $this-&gt;past_bday[] = array('mem_name' =&gt; $members[$i]-&gt;name);
              }
              else if(date('d-m')&lt; date('d-m',$bday) &amp;&amp; date('d-m',$bday) &lt;= date('d-m',$week_after)){
                  $this-&gt;future_bday[] = array('mem_name' =&gt; $members[$i]-&gt;name);
              }
          }
  </code></pre>
  
  <p>The date format returned from the db is <code>yyyy-mm-dd</code> i.e <code>1960-06-12</code>. This code works fine for 1 week before and today but 1 week after returning if the year is below 1970 and 1 week after condition completely fails.</p>
  
  <p>Can anyone provide me with proper date manipulation for the correct results please?</p>