jsp
<input name="startTime" id="startTime" class="easyui-datebox" style="width:160px;height:30px"/>
js
function myformatter2(date){
var y = date.getFullYear();
var m = date.getMonth()+1;
var d = date.getDate();
return y+'-'+(m<10?('0'+m):m)+'-'+(d<10?('0'+d):d);
}
$(function () {
var curr_time = new Date();
$("#endTime").datebox("setValue",myformatter2(curr_time));
})
最后效果