var date = new Date(),
            year = date.getFullYear(),
            month = date.getMonth() + 1,
            day = date.getDate(),
            week = date.getDay(),
            str = '',
            hour = date.getHours() < 10 ? "0" + date.getHours() : date.getHours(),
            minute = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes(),
            second = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
            month >= 1 && month <= 9 ? (month = "0" + month) : "";
            day >= 0 && day <= 9 ? (day = "0" + day) : "";
            if (week == 0) {  
                    str = "周日";  
            } else if (week == 1) {  
                    str = "周一";  
            } else if (week == 2) {  
                    str = "周二";  
            } else if (week == 3) {  
                    str = "周三";  
            } else if (week == 4) {  
                    str = "周四";  
            } else if (week == 5) {  
                    str = "周五";  
            } else if (week == 6) {  
                    str = "周六";  
            }  

 

相关文章:

  • 2022-03-02
  • 2021-06-25
  • 2021-11-25
  • 2021-10-04
  • 2022-02-10
  • 2022-01-23
  • 2021-07-24
  • 2022-03-03
猜你喜欢
  • 2022-12-23
  • 2021-06-02
  • 2021-11-22
  • 2022-12-23
  • 2021-05-21
  • 2021-05-16
  • 2021-09-24
相关资源
相似解决方案