var date = new Date();
var year = date.getFullYear();
var month = date.getMonth() + 1;
var dates = date.getDate();
var hour = date.getHours();
var minutes = date.getMinutes();
var second = date.getSeconds();
var dataTime = year + "-" + month + "-" + dates + " " + hour + ":" + minutes + ":" + second;
console.log(dataTime, "dataTime")
js获取当天日期时间
最新推荐文章于 2024-07-18 11:50:26 发布