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