I am using a bootstrapdatetimepicker as well as moment.js
When i call the following
var starteventtime= ($('#startdatetime').data('DateTimePicker').date());
I get a date similar to
Wed Mar 27 2019 00:00:00 GMT+0000
I also have the option for the user to save their own format of the date. So any code will have to take this into consideration.
<?php
   $datetimeformat = 'DD/MM/YYYY HH:mm';
 ?>
    $(function() {
             $('#startdatetime').datetimepicker({
             format: '<?php echo $datetimeformat; ?>'
    });
How do i parse this on the client side with javascript to get Mysql formatted date so when the data is serialized it will be in a format ready for insertion into the database like below
2019-03-27 00:00:00
 
     
    