title: PHP datetime add one second
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/842974/php-date-time">PHP date time</a>  </p>
  </blockquote>
  
  
  
  <p>Trying to add one second to a datetime that is input by the user
  $values['start_date_'.$j.'-'.$i] is a valid datetime string, however the following code is throwing an error  </p>
  
  <pre><code>$priceStart = date('Y-m-d H:i:s',strtotime($values['start_date_'.$j.'-'.$i]));
  date_modify($priceStart, '+1 second');
  $priceStart =date_format($priceStart, 'Y-m-d H:i:s');
  </code></pre>
  
  <p>The error is "date_modify() expects parameter 1 to be DateTime, string given in... on line..."
  same error follows for date_format()</p>
  
  <p>what is the correct syntax for this?</p>