title: Not getting correct date in Carbon parse
body: <p>I'm using laravel 5.6 and adding a date through dx data grid, however it is giving a current date which is not what I selected.</p>
  
  <p>I have tried to change the date format, but in this case, the date is correct. After first insertion it is giving me wrong date (i.e. 1970-01-01).</p>
  
  <pre><code>$grids = $request-&gt;except('_token');
  $request-&gt;request-&gt;set('attendance_date', Carbon::parse($request- 
  &gt;attendance_date)-&gt;format('Y-m-d'));
  
  $grids=array();
  $grids['name'] = $request['item']['name'];
  $grids['attendance_type'] = $request['item']['attendance_type'];
  $grids['dept'] = $request['item']['dept'];
  $grids['user_id'] = $request['item']['user_id'];
  $grids['attendance_date'] = $request-&gt;attendance_date;
  $grids['attendance_month'] = $request-&gt;attendance_month;
  $grids['attendance_year'] = $request-&gt;attendance_year;
  $grids['org_name'] = $request-&gt;org_name;
  $grids['org_id'] = $request-&gt;org_id;
  dd($grids);
  
    $requesteddate = $request-&gt;attendance_date;
    $requesteduser_id = $grids['user_id'];
    $attendances = DB::table('attendances')-&gt;where(['user_id' =&gt; 
    $requesteduser_id])-&gt;get()-&gt;toArray();
     foreach ($attendances as $key =&gt; $value) {
      $dbattendance_date = $value-&gt;attendance_date;
      $dbattendance_user_id = $value-&gt;user_id;
  
      if ($dbattendance_date == $requesteddate &amp;&amp; $dbattendance_user_id == 
         $requesteduser_id) {
  
          $insert['status'] = 'error';
          $insert['message'] = 'Attendance Already Exits';
          return Response()-&gt;json($insert);
  
      }
  }
  $insert = Attendance::create($grids);
  return Response()-&gt;json($insert);
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/ovmfs.png" alt="enter image description here"></p>