js获取时间戳

<!DOCTYPE html>
<html lang="zh">

    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <meta http-equiv="X-UA-Compatible" content="ie=edge" />
        <title>tips-js获取时间戳</title>
    </head>

    <body>

        <script type="text/javascript">
            let d = new Date(2018, 10, 30, 18, 00, 30)
            //方法一
            console.log(+d)
            //方法二
            console.log(d.getTime())
        </script>
    </body>

</html>
原文地址:https://www.cnblogs.com/mengfangui/p/9878506.html