1.获取当月时间格式: yyyy-MM

getNowFormatDate() {//获取当月时间 yyyy-MM
            var date = new Date();
            var year = date.getFullYear();
            var month = date.getMonth() + 1;
            if (month >= 1 && month <= 9) {
                month = '0' + month;
            }
            var currentdate = year + '-' + month
            return currentdate;
            //   console.log(currentdate) ;
}
View Code

相关文章:

  • 2021-09-29
  • 2021-08-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-27
  • 2022-12-23
  • 2021-12-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案