Date对象

 1 <!DOCTYPE html>
 2 <html>
 3     <head>
 4         <meta charset="UTF-8">
 5         <title>Date对象</title>
 6         <script type="text/javascript">
 7             var today=new Date(); //通过new方法创建对象
 8             //alert(Date());  //返回一个完整的日期 
 9             //alert(today.getDay()); //返回当天是周几
10             //alert(today.getMonth()+1);//返回当前月份getMonth() 0~11
11             //alert(today.getHours());//返回当前的小时
12             //alert(today.getFullYear());//返回当前的年份
13             //alert(today.getMinutes());//返回当前的分钟
14             //alert(today.getSeconds());//返回当前的秒钟
15         </script>
16     </head>
17     <body>
18         
19     </body>
20 </html>
原文地址:https://www.cnblogs.com/BingBing-Deng/p/10237540.html