The getMonth() or e.selectedMonth method returns the month in the specified date according to local time, as a zero-based value (where zero indicates the first month of the year).
An integer number, between 0 and 11, representing the month in the given date according to local time. 0 corresponds to January, 1 to February, and so on.
$(document).ready(function(){
$('#datepicker').datepicker({
dateFormat: 'dd-mm-yy',
onSelect: function(dateText, e){
$('.selectedDate').text(dateText);
$('.objectDate').text(e.selectedDay + '-' + ( e.selectedMonth +1) + '-' + e.selectedYear);
}
});
});
<link href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
<div id="datepicker">
</div>
<br>
<div>
Selected Date: <span class="selectedDate"></span><br>
Object Date: <span class="objectDate"></span>
</div>
JS fiddle demo : https://jsfiddle.net/geogeorge/c91jfzn7/