• js获取本月开始时间和结束时间


    var firstDate = new Date();
            var startDate = firstDate.getFullYear()+"-"+((firstDate.getMonth()+1)<10?"0":"")+(firstDate.getMonth()+1)+"-"+"01";
            //alert(firstDate.getFullYear()+"-"+((firstDate.getMonth()+1)<10?"0":"")+(firstDate.getMonth()+1)+"-"+"01");
    
            var date=new Date();
            var currentMonth=date.getMonth();
            var nextMonth=++currentMonth;
            var nextMonthFirstDay=new Date(date.getFullYear(),nextMonth,1);
            var oneDay=1000*60*60*24;
            var lastDate =  new Date(nextMonthFirstDay-oneDay);
            var  endDate = lastDate.getFullYear()+"-"+((lastDate.getMonth()+1)<10?"0":"")+(lastDate.getMonth()+1)+"-"+(lastDate.getDate()<10?"0":"")+lastDate.getDate();
            //alert(lastDate.getFullYear()+"-"+((lastDate.getMonth()+1)<10?"0":"")+(lastDate.getMonth()+1)+"-"+(lastDate.getDate()<10?"0":"")+lastDate.getDate());
    
    }

  • 相关阅读:
    ansible-乱
    linux-PXE-12
    linux-ntp-10
    linux-selinxu---性能 -8
    linux-系统启动流程-7
    linux-网络管理-6
    linux-文件系统-5
    linux-包管理器-4
    linux-shell脚本基础-2
    linux-history-ps1-1
  • 原文地址:https://www.cnblogs.com/duguxiaobiao/p/9128834.html
Copyright © 2020-2023  润新知