……

时间

Posted on 2022-08-22 13:35  WALL*E  阅读(48)  评论(0编辑  收藏  举报
getTime(){
      let timess = new Date();
      const formTime = {
        y: timess.getFullYear(),
        m: timess.getMonth() + 1,
        d: timess.getDate(),
        h: timess.getHours(),
        s: timess.getMinutes(),
        ss: timess.getSeconds()
      };
     this.printTime = formTime.y+'-' + ("0" + (formTime.m)).slice(-2)+'-'+("0" + (formTime.d)).slice(-2)+' '+("0" + (formTime.h)).slice(-2)+':'+("0" + (formTime.s)).slice(-2)+':'+("0" + (formTime.ss)).slice(-2)
	 //2022-12-12 12:02:01
    },