title: Call to a member function diff() on string
body: <p>Please help me to convert the string causing the error!<br></p>
  
  <p><strong>PHP</strong></p>
  
  <pre><code>$string_date = "2015-04-16 12:00:00";
  $date = new DateTime($string_date);
  
  //Put breaks in array
  $usr_breaks = $stmt2-&gt;fetch();
  
  //Put break 1 in variable
  $usr_break_1 = $usr_breaks['skift_rast1'];
  
  //Split usr_break 1 to calculate duration
  list($break_1_start, $break_1_ends) = explode("-", $usr_break_1);
  // (09:00, 09:20) = explode "-", 09:00-09:20
  
  //Create Datetime objekt
  $break_1_start = $date-&gt;format('Y-m-d ').$break_1_start;
  $break_1_ends = $date-&gt;format('Y-m-d ').$break_1_ends;
  
  //Calculate break 1 duration
  $break_1_dur = $break_1_start-&gt;diff($break_1_ends); //This line is error
  echo $break_1_dur-&gt;format('H:i');
  </code></pre>