运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
转到 Spaces
<!DOCTYPE html> <html> <body> <h1>JavaScript Dates</h1> <h2>The getTime() Method</h2> <p>The internal clock in JavaScript starts at midnight January 1, 1970.</p> <p>getTime() returns the number of milliseconds since January 1, 1970:</p> <p id="demo"></p> <script> const d = new Date(); let time = d.getTime(); document.getElementById("demo").innerHTML = time; </script> </body> </html>