mmzuo-798
js 获取当前月份 第一天和最后一天
var now = new Date(); //当前日期 
    var nowMonth = now.getMonth(); //当前月 
    var nowYear = now.getFullYear(); //当前年 
    //本月的开始时间
    var monthStartDate = new Date(nowYear, nowMonth, 1); 
    //本月的结束时间
    var monthEndDate = new Date(nowYear, nowMonth+1, 0);
    var timeStar=Date.parse(monthStartDate)/1000;//s
    var timeEnd=Date.parse(monthEndDate)/1000;//s

注意:js是精确毫秒的,php是精确到秒的

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-29
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-27
  • 2021-07-05
  • 2022-12-23
  • 2022-12-23
  • 2021-06-20
相关资源
相似解决方案