首页 > 其他分享 >时间

时间

时间:2022-08-22 13:44:48浏览次数:43  
标签:02 slice ss timess 12 时间 formTime

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
    },

标签:02,slice,ss,timess,12,时间,formTime
From: https://www.cnblogs.com/cyapi/p/16612538.html

相关文章