Date日期对象

内部对象

标准对象:

 

 

  Date:

 1 <!DOCTYPE html>
 2 <html lang="en">
 3 <head>
 4     <meta charset="UTF-8">
 5     <title>Title</title>
 6     <script>
 7 
 8         var now = new Date();
 9         now.getFullYear();
10         now.getMonth();//0-11代表 1-12月
11         now.getDate();
12         now.getDay();
13         now.getHours();
14         now.getMinutes();
15         now.getSeconds();
16 
17         now.getTime();//时间戳 全世界统一 1970.
18         console.log(new Date(1648555413326));//查看时间
19 
20         now.toLocaleString();
21         
22     </script>
23 </head>
24 <body>
25 
26 </body>
27 </html>

 

posted @ 2022-03-29 20:10  doremi429  阅读(18)  评论(0编辑  收藏  举报