I am using jQuery datepicker, and I am displaying my date in
dd-mm-yyyy
format but I need to send date in
yyyy-mm-dd
format to store in database.
$(document).ready(function(){
$('.datepicker').datepicker({
format : 'dd-mm-yyyy',
maxDate : new Date(),
selectMonths : true,
selectYears: d,
yearRange: 100 ,
});
});
the above code will show date format
dd-mm-yy
and when I submit the form using ajax, it sends using this same format. I need to change the submit format to
yyyy-mm-dd
Check this fiddle.