日期格化式函数

106 阅读1分钟
 getTime(date) {
      let year = date.getFullYear();
      let month =('00' +( date.getMonth() + 1)).slice(-2);
      let day = ('00' +date.getDate()).slice(-2)
      return year + "-" + month + "-" + day;
    },