js内置date类

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>内置Date日期类</title>
</head>
<body>
    <script type="text/javascript">
        var nowTime=new Date();
        document.write(nowTime.toString());
        var strTime=nowTime.toLocalString();
        document.write(strTime);
        var year=nowTime.getYear();
        year=nowTime.getFullYear();
        var time=nowTime.getTime();
        alert(time);
    </script>
</body>
</html>

posted @ 2018-02-05 16:25  超重语言  阅读(93)  评论(0编辑  收藏  举报