js獲取時間戳
阿新 • • 發佈:2018-10-30
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獲取時間戳