您的位置:首页 > 产品设计 > UI/UE

EasyUI datetimebox显示当前时间

2017-07-30 16:28 513 查看

easyui-datebox 和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;

};

$('#startTime1').datetimebox('setValue', formatterDate(new Date()));

//前端

<div id="startTime1" class="easyui-datetimebox"></div>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: