zoukankan      html  css  js  c++  java
  • 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());
    
    }

  • 相关阅读:
    主机连接不上虚拟机或虚拟机桥接没有网络
    asp web 报表
    heart or house?
    CPointer
    Raid
    Dos for by 随风
    不支持uri格式
    FabEdge V0.4 新特性:支持多集群通讯
    运维监控
    /etc缩写
  • 原文地址:https://www.cnblogs.com/duguxiaobiao/p/9128834.html
Copyright © 2011-2022 走看看