easyUI datebox 精确到秒并且显示值

1.前端input (data-options="editable:true"  这个不要也可以,如果有需要设置为true )

<input id="xxx" name="xxx" class="easyui-datebox" data-options="editable:true" />

 2.js代码,此处showSeconds: false则不显示秒,showSeconds: true 则显示秒

//时间时分秒
    $('#xxx').datetimebox({
        value: '3/4/2010 0:0',
        required: true,
        showSeconds: false
    });

3.取值,设值

//设值
$('#xxx').datebox({'setValue', '2021-10-25 14:23'});
$('#xxx').datebox({'setValue', '2021-10-25 14:23:00'});

//取值
$('#xxx').datebox("getValue");
原文地址:https://www.cnblogs.com/xuelishuyue/p/15459167.html