title: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value
body: <p>I'm implementing full calendar API into my project .I have a problem when I try to save an event , I keep on getting the following error:</p>
  
  <pre><code>SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '2017-07-1415:41:03' for column 'start' at row 1 (SQL: insert into `event3s` (`title`, `start`, `end`, `color`) values (New event, 2017-07-1415:41:03, , #9e1515))
  </code></pre>
  
  <p>I have changed to the right time(time zone) in phpmyadmin but I still got the same error.</p>
  
  <p>This is my table in phpmyadmin :
  [![enter image description here][1]][1]</p>
  
  <p>This is the calendar.blade.php class :</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html lang="{{ config('calendar.locale') }}"&gt;
  &lt;head&gt;
  
      &lt;meta charset="utf-8"&gt;
      &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
      &lt;meta name="csrf-token" content="{{ csrf_token() }}"&gt;
      &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt;
      &lt;title&gt;Full Calendar&lt;/title&gt;
  
      {!! Html::style('vendor2/seguce92/bootstrap/css/bootstrap.min.css') !!}
      {!! Html::style('vendor2/seguce92/fullcalendar/fullcalendar.min.css') !!}
      {!! Html::style('vendor2/seguce92/bootstrap-datetimepicker/css/bootstrap-material-datetimepicker.css') !!}
      {!! Html::style('vendor2/seguce92/bootstrap-colorpicker/css/bootstrap-colorpicker.min.css') !!}
  
  &lt;/head&gt;
  &lt;div id='app'&gt;&lt;/div&gt;
  &lt;div class='container'&gt;&lt;/div&gt;
  
  {{ Form::open(['route' =&gt; 'user.events.store', 'method' =&gt; 'post', 'role' =&gt; 'form']) }}
  &lt;div id="responsive-modal" class="modal fade" tabindex="-1" data-backdrop="static"-&gt;
  
      &lt;div class="modal-dialog"&gt;
          &lt;div class="modal-content"&gt;
  
          &lt;div class="modal-header"&gt;
          &lt;h4&gt;Registration of new Event&lt;/h4&gt;
  
          &lt;/div&gt;
  
          &lt;div class="modal-body"&gt;
  
              &lt;div class="form-group"&gt;
                  {{Form::label('title','Date Start') }}
                  {{Form::text('title',old('title'),['class' =&gt; 'form-control'])}}
              &lt;/div&gt;
  
          &lt;div class="form-group"&gt;
              {{Form::label('date_start','Date Start') }}
              {{Form::text('date_start',old('date_start'),['class' =&gt; 'form-control','readonly'=&gt;'true'])}}
          &lt;/div&gt;
  
              &lt;div class="form-group"&gt;
                  {{Form::label('time_start','Time Start') }}
                  {{Form::text('time_start',old('time_start'),['class' =&gt; 'form-control'])}}
              &lt;/div&gt;
  
              &lt;div class="form-group"&gt;
                  {{Form::label('date_end','Time Finish') }}
                  {{Form::text('date_end',old('date_end'),['class' =&gt; 'form-control'])}}
              &lt;/div&gt;
  
              &lt;div class="form-group"&gt;
                  {{Form::label('color','COLOR') }}
                  &lt;div class="input-group colorpicker"&gt;
                      {{ Form::text('color',old('color'),['class' =&gt; 'form-control']) }}
                      &lt;span class ="input-group-addon"&gt;
  
                          &lt;i&gt;&lt;/i&gt;
                      &lt;/span&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;div class="modal-footer"&gt;
              &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Cancel&lt;/button&gt;
              {!! Form::submit('Save',['class' =&gt; 'btn-btn-success'])!!}
  
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;/div&gt;
  
  &lt;/div&gt;
  {{Form::close()}}
  &lt;div id='calendar'&gt;&lt;/div&gt;
  
  &lt;/body&gt;
  
  {!! Html::script('vendor2/seguce92/jquery.min.js') !!}
  {!! Html::script('vendor2/seguce92/bootstrap/js/bootstrap.min.js') !!}
  {!! Html::script('vendor2/seguce92/fullcalendar/lib/moment.min.js') !!}
  {!! Html::script('vendor2/seguce92/fullcalendar/fullcalendar.min.js') !!}
  {!! Html::script('vendor2/seguce92/bootstrap-datetimepicker/js/bootstrap-material-datetimepicker.js') !!}
  {!! Html::script('vendor2/seguce92/bootstrap-colorpicker/js/bootstrap-colorpicker.min.js') !!}
      &lt;script type="text/javascript"&gt;
      var BASEURL="{{url('/')}}";
          $(document).ready(function() {
  
              $('#calendar').fullCalendar({
                  header: {
                      left: 'prev,next today',
                      center: 'title',
                      right: 'month,basicWeek,basicDay'
                  },
  
                  navLinks: true, // can click day/week names to navigate views
                  editable: true,
                  selectable:true,
                  selectHelper:true,
  
                  select:function(start){
                      start = moment(start.format());
  
                      $('#date_start').val(start.format('YYYY-MM-DD'));
                      $('#responsive-modal').modal('show');
                  },
                  events: BASEURL+'/events'
  
              });
  
          });
  
          $('.colorpicker').colorpicker();
  
          $('#time_start').bootstrapMaterialDatePicker({
  
                  date:false,
                  shortTime: false,
                  format: 'HH:mm:ss'
          });
  
      $('#date_end').bootstrapMaterialDatePicker({
  
          date:true,
          shortTime: false,
          format: 'YYYY-MM-DD'
      });
  </code></pre>
  
  <p>One thing to note is that I had to create the table through phpmyadmin ,I was not able to migrate table from my code .</p>
  
  <p>Also I have tried to change <code>YYYY-MM-DD</code> to <code>Y-m-d H:i:s</code></p>
  
  <p>This is my migration class:</p>
  
  <pre><code>class CreateEvent3sTable extends Migration
  {
      /**
       * Run the migrations.
       *
       * @return void
       */
      public function up()
      {
          Schema::create('event3s', function (Blueprint $table) {
              $table-&gt;increments('id');
              $table-&gt;string('title');
              $table-&gt;datetime('start');
              $table-&gt;datetime('end');
              $table-&gt;string('color', 7);
              $table-&gt;timestamps();
          });
      }
  
      /**
       * Reverse the migrations.
       *
       * @return void
       */
      public function down()
      {
          Schema::dropIfExists('event3s');
      }
  }
  </code></pre>
  
  <p>This is my controller where the saving process is meant to happen:</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers;
  
  use Illuminate\Http\Request;
  use App\Event3;
  class EventsController extends Controller
  {
      /**
       * Display a listing of the resource.
       *
       * @return \Illuminate\Http\Response
       */
      public function index()
      {
          $data = Event3::get(['title','start','end','color']);
  
         return Response()-&gt;json($data);
      }
  
      /**
       * Show the form for creating a new resource.
       *
       * @return \Illuminate\Http\Response
       */
      public function create()
      {
          //
      }
  
      /**
       * Store a newly created resource in storage.
       *
       * @param  \Illuminate\Http\Request  $request
       * @return \Illuminate\Http\Response
       */
      public function store(Request $request)
      {
         $event = new Event3();
         $event-&gt;title = $request-&gt;title;
         $event-&gt;start = $request-&gt;date_start .''. $request-&gt;time_start;
         $event-&gt;end = $request-&gt;data_end;
         $event-&gt;color = $request-&gt;color;
          $event-&gt;save();
  
          return redirect('/');
      }
  
      /**
       * Display the specified resource.
       *
       * @param  int  $id
       * @return \Illuminate\Http\Response
       */
      public function show($id)
      {
          //
      }
  
      /**
       * Show the form for editing the specified resource.
       *
       * @param  int  $id
       * @return \Illuminate\Http\Response
       */
      public function edit($id)
      {
          //
      }
  
      /**
       * Update the specified resource in storage.
       *
       * @param  \Illuminate\Http\Request  $request
       * @param  int  $id
       * @return \Illuminate\Http\Response
       */
      public function update(Request $request, $id)
      {
          //
      }
  
      /**
       * Remove the specified resource from storage.
       *
       * @param  int  $id
       * @return \Illuminate\Http\Response
       */
      public function destroy($id)
      {
          //
      }
  }
  </code></pre>