在JS中自定义new Date()时间

let date = new Date();
          let year = date.getFullYear();
          let month = date.getMonth() + 1;
          let date2 = date.getDate();
          let hours = date.getHours();
          let seconds = date.getSeconds();
          let minutes = date.getMinutes();
          let time = JSON.stringify(year + '-' + month + '-' + date2 + ' ' + hours + ':' + minutes + ':' + seconds);

猜你喜欢

转载自blog.csdn.net/qq_42427109/article/details/84975647
今日推荐