前言:
效果:
![](https://img.laitimes.com/img/9ZDMuAjOiMmIsIjOiQnIsIyZuBnLxYTOwQzMxYTM5EjMxgTMwIzLc52YucWbp5GZzNmLn9Gbi1yZtl2Lc9CX6MHc0RHaiojIsJye.png)
<!DOCTYPE html>
<html >
<head>
<meta charset="UTF-8" />
<title>Document</title>
</head>
<body>
<script>
function formatDate() {
now = new Date().getTime();
return now
}
console.log(formatDate());//当前时间戳
</script>
</body>
</html>