太久远的版本,你只有自己测试看看js了。设置每1秒刷新
setInterval(function(){
const now = new Date();
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, '0');
const day = String(now.getDate()).padStart(2, '0');
const hours = String(now.getHours()).padStart(2, '0');
const minutes = String(now.getMinutes()).padStart(2, '0');
const seconds = String(now.getSeconds()).padStart(2, '0');
const formattedDate = year+"-"+month+"-"+day+" "+hours+":"+minutes+":"+seconds;
console.log(formattedDate);//可以把这个修改成赋值到控件或者单元格
}, 1000);