获取当前时间

//获取当前时间
var date = new Date();
var year = date.getFullYear();
var month = date.getMonth() + 1;
var day = date.getDate();
if (month < 10) {
    month = "0" + month;
}
if (day < 10) {
    day = "0" + day;
}
var nowDate = year + "-" + month + "-" + day;

  

posted @ 2021-05-18 13:58  宸泽岚  阅读(25)  评论(0编辑  收藏  举报