title: How do you pass a string value in PHP into a sqlsrv() datetime value?
body: <p>I have 3 form values that I concatenate to create a date of birth:</p>
  
  <pre><code>$b_dob = new DateTime($b_dob3."-".$b_dob1."-".$b_dob2);
  </code></pre>
  
  <p>And I'm trying to do an INSERT with this (datetime) value (which is part of an array):</p>
  
  <pre><code>$insertinapp[ 'b_dob' ] = date_format($b_dob, 'Y-m-d H:i:s');
  </code></pre>
  
  <p>And I keep getting this error:</p>
  
  <p>The conversion of a varchar data type to a datetime data type resulted in an out-of-range value. </p>
  
  <p>Am I adding characters to the new DateTime string that make it invalid for date_format, or is the issue using date_format?</p>