javascript取一周的日期

上代码:

    <script>
        var today = new Date();
        for (var i = 0; i < 7; i++) {
            today.setDate(today.getDate() + i);
            document.write(today.toLocaleDateString() + "<br />");
        }
    </script>

链接:http://www.w3school.com.cn/jsref/jsref_obj_date.asp

posted @ 2016-08-17 10:27  talentzemin  阅读(148)  评论(0)    收藏  举报