19_日期.html 595 B

12345678910111213141516171819
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>Document</title>
  8. </head>
  9. <body>
  10. <script>
  11. //Date 采取的是时间戳的形式 表示时间 所谓的时间戳就是指 从1970年1月1日0时0分0秒 开始经过毫秒来计算的时间
  12. var a = new Date()
  13. console.log(a.getTime())
  14. console.log(a.getFullYear())
  15. console.log(a.getMonth())
  16. //getMonth() 以数字(0-11)返回日历的月份
  17. </script>
  18. </body>
  19. </html>