function getNowTimeStr() {
var now = new Date();
return now.toLocaleDateString().replace(/\//g, "-") + " " + now.toTimeString().substr(0, 8);
}
js中获取当前时间,并转化为yyyy-MM-dd hh-mm-ss
最新推荐文章于 2024-04-22 17:24:26 发布
function getNowTimeStr() {
var now = new Date();
return now.toLocaleDateString().replace(/\//g, "-") + " " + now.toTimeString().substr(0, 8);
}