js 获取时间相关


        $(document).ready(function () {
            var date = new Date();
            var sb = "";
            for (var i = 0; i < getDaysInMonth(date.getFullYear(), (date.getMonth() + 2)) ; i++) {
                sb += '<td><\%#Eval("' + (i + 1) + '")%></td>';
            }
            $("#day").innerText(sb);
            alert($("#day").innerText())
        })
        function getDaysInMonth(year, month) {
            month = parseInt(month, 10) + 1;
            var temp = new Date(year + "/" + month + "/0");
            return temp.getDate();
        }

posted @ 2014-07-10 17:27  yufeiyunsui  阅读(112)  评论(0编辑  收藏  举报