title: Type error: DateTime::__construct() expects parameter 1 to be string, object given in laravel
body: <p>I am trying to get late time. $latetime1 returning correct but $latetime2 not returning same as $latetime1. $systemIntime value format and $inTime value format are the same. But I am getting above error for $latetime2. What should be the correct one, please someone help me.
  Here is my function bellow -</p>
  
  <pre><code>public function update(Request $request, Attendance $attendance)
  {
      $attendance = Attendance::find($attendance-&gt;id);
      $inTime = $attendance-&gt;intime;
      // late time caculate
      $systemIntime = DB::table('schools')
                       -&gt;join('users', 'schools.id', '=', 'users.school_id')
                       -&gt;select('schools.intime')
                       -&gt;first();
      $latetime1 = (new \DateTime($inTime))-&gt;format('H:i:s');
      $latetime2 = (new \DateTime($systemIntime))-&gt;format('H:i:s');
      $late      = $latetime1-&gt;diff($latetime2);
  </code></pre>