title: Struggling with strtotime, getting expect parameter 2 to be long error
body: <p>I am trying to write a script that will calculate dates into a database depending on the value entered for <code>cdr_original_install_date</code>.</p>
  
  <p>If if is blank I would like it to enter NULL for both <code>$cdr_install</code> and <code>$cdr_renew</code>.</p>
  
  <p>If not I would like <code>$cdr_install</code> to be the date entered in <code>cdr_original_install_date</code>, <code>$cdr_renew</code> to be the same date plus one year.  If the <code>$cdr_renew</code> date has not passed I would like it to change the value of $cdr_support to 'Initial Warranty';</p>
  
  <p>I have tried several ways to write this but the only bit that works is if no date is entered NULL is saved to the database.  If I enter a date I either get dates entered as 1970-01-01 or an error saying that <code>strtotime()</code> expects parameter 2 to be long, string given which refers to the line adding one year to <code>$cdr_install</code>.</p>
  
  <pre><code>if($_POST['cdr_original_install_date'] == ''){
      $cdr_install = 'NULL';
      $cdr_renew = 'NULL';
  } else {
      $cdr_install = date('Y-m-d', strtotime($_POST['cdr_original_install_date']));
      $cdr_renew = date('Y-m-d', strtotime($cdr_install,'+ 1 year'));
          if(strtotime($cdr_renew) &gt; time()){
              $cdr_support = 'Initial Waranty';
          }
  }
  </code></pre>
  
  <p>The database field are just date so the problem doesn't appear to be the formatting of the date value </p>