title: Change datetimepicker format in Laravel
body: <p>Hey guys i am trying to compare the <code>date</code> from my database and the date range i select from my datetimepicker. It is unable to compare because the format of both differ from one another. The <code>date</code> in my database has the format of <code>YYYY-MM-DD</code> while the format from the datetimepicker is <code>MM-DD-YYYY</code>. I am trying to convert the format of the datetimepicker to match with the format in my database. How can i accomplish this??</p>
  
  <pre><code>{!! Form::input('date', 'endDate', null, ['id' =&gt; 
  'datetimepicker','class' =&gt; 'datepicker', 'data-date-format' =&gt; 'yy/mm/dd']) !!}
  
  &lt;script type="text/javascript"&gt;
  
  $('#datetimepicker').datetimepicker({
     dateFormat: 'yyyy-mm-dd'
  });
  &lt;/script&gt;  
  </code></pre>
  
  <p><strong>Format in datetimepicker</strong></p>
  
  <p><a href="https://i.stack.imgur.com/FMjCX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FMjCX.png" alt="format in datetimepicker"></a></p>
  
  <p><strong>Format in database</strong></p>
  
  <p><a href="https://i.stack.imgur.com/AHBrp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AHBrp.png" alt="format in database"></a></p>