标准时间转换

onChangeTime(e) {
   var d = new Date(e._d);
   var youWant = this.time(d.getFullYear()) + '-' +  this.time((d.getMonth() + 1)) + '-' +  this.time(d.getDate());
  console.log(youWant)
},
time(s) {
    return s < 10 ? '0' + s : s;
},

猜你喜欢

转载自www.cnblogs.com/fanqiuzhuji/p/12197110.html
今日推荐