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>
|