<!DOCTYPE html>
<html>
<body>
<h1>JavaScript new Date() 方法</h1>
<p>使用不带参数的 new Date() 方法,将创建一个包含当前日期和时间的日期对象:</p>
<p id="demo"></p>
<script>
const d = new Date();
document.getElementById("demo").innerHTML = d;
</script>
</body>
</html>