1. 程式人生 > >js獲取時間戳

js獲取時間戳

size ips htm spa har charset ont col ()

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

js獲取時間戳