首页 > 编程语言 > 详细

JavaScript获取当前日期

时间:2016-08-01 21:10:48      阅读:353      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!