码迷,mamicode.com
首页 > 编程语言 > 详细

JavaScript获取当前日期

时间:2016-08-01 21:13:28      阅读:139      评论:0      收藏:0      [点我收藏+]

标签:

<html>
    <head>
        <title>日期</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script type="text/javascript">
            var nowTime = new Date();
            //获取日期的年月日
            var c = ":";
            var year = nowTime.getYear();
            var month = nowTime.getMonth();
            var date = nowTime.getDate();
            var hours = nowTime.getHours();
            var minute = nowTime.getMinutes();
            var seconds = nowTime.getSeconds();
            var s = "当前本地时间:";
            s = year+c+month+c+date+" "+hours+c+minute+c+seconds;
            debugger;
        </script>
    </head>
    <body>
    </body>
</html>

 

JavaScript获取当前日期

标签:

原文地址:http://www.cnblogs.com/wangqiang4518/p/5727188.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!