我有这个示例代码:
<div id="calendar"></div> $(document).ready(function() { $('#calendar').datepicker({ dateFormat: 'yy-m-d',inline: true,onSelect: function(dateText,inst) { var month = dateText.getUTCMonth(); var day = dateText.getUTCDate(); var year = dateText.getUTCFullYear(); alert(day+month+year); } }); });