databox 当前日期:
class="easyui-datebox"
var curr_time = new Date();
var strDate = curr_time.getFullYear() + "-";
strDate += curr_time.getMonth() + 1 + "-";
strDate += curr_time.getDate() + "-";
strDate += curr_time.getHours() + ":";
strDate += curr_time.getMinutes() + ":";
strDate += curr_time.getSeconds();
$("#openTime").datetimebox("setValue", strDate);
datatimebox 当前日期(包含时分秒):
class="easyui-datetimebox"
formatterDate = function (date) {
var day = date.getDate() > 9 ? date.getDate() : "0" + date.getDate();
var month = (date.getMonth() + 1) > 9 ? (date.getMonth() + 1) : "0"
+ (date.getMonth() + 1);
var hor = date.getHours();
var min = date.getMinutes();
var sec = date.getSeconds();
return date.getFullYear() + '-' + month + '-' + day+" "+hor+":"+min+":"+sec;
};
$("#closeTime").datetimebox("setValue",formatterDate(new Date()));