Date not being saved to mySQL datebase with laravel
<p>I've got a jquery datepicker</p>

<pre><code>$(function() {
    var date = new Date();
    var currentMonth = date.getMonth();
    var currentDate = date.getDate();
    var currentYear = date.getFullYear();
    $('.datepicker').datepicker({
    showOn: 'focus',changeMonth: true,
    minDate: new Date(currentYear, currentMonth, currentDate),
    changeYear: true,

});
});
</code></pre>

<p>with some validation</p>

<pre><code>    $this-&gt;validate($request, [
        "date" =&gt; 'required|date',
    ]);
</code></pre>

<p>and some conversion for the date to pass through to the database</p>

<pre><code>    $date = $request-&gt;input('date');
    $date2 = DateTime::createFromFormat('m/d/Y',$date);
    $date3 = $date2-&gt;format("Y-d-m");
</code></pre>

<p>If I dd($date3) at this point, with a chosen date, I get something like this </p>

<pre><code>"2016-29-09"
</code></pre>

<p>All well and good, mysql appears to save in a y-d-m format.</p>

<p>Now when I go to pass it through</p>

<pre><code>    Message::where('id', $messageId)-&gt;update([
        'updated_at' =&gt; Carbon\Carbon::now(),
        'subject' =&gt; 'Status: Price quote delivered.',  
        'quoted' =&gt; 1,
        'price' =&gt; $request-&gt;input('price'),
        'estimated_date'  =&gt; $date3,            
    ]);
</code></pre>

<p>everything gets passed to the database except the date. The date just stays at 0000-00-00 in the database.</p>

<p>Help?</p>