1 //获取当前时间,格式YYYY-MM-DD
 2     function getNowFormatDate() {
 3         var date = new Date();
 4         var seperator1 = "-";
 5         var year = date.getFullYear();
 6         var month = date.getMonth() + 1;
 7         var strDate = date.getDate();
 8         if (month >= 1 && month <= 9) {
 9             month = "0" + month;
10         }
11         if (strDate >= 0 && strDate <= 9) {
12             strDate = "0" + strDate;
13         }
14         var currentdate = year + seperator1 + month + seperator1 + strDate;
15         return currentdate;
16     }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-05
  • 2022-01-09
  • 2022-12-23
  • 2022-02-06
  • 2021-10-07
猜你喜欢
  • 2022-12-23
  • 2022-02-28
  • 2021-11-18
  • 2021-12-23
  • 2022-02-02
相关资源
相似解决方案