執行 ❯
建立您
自己的
網站
×
改變方向
儲存程式碼
改變主題,深色/淺色
前往 Spaces
<!DOCTYPE html> <html> <body> <h1>JavaScript Dates</h1> <h2>The new Date() Method</h2> <p>new Date() creates a new date object with the current date and time:</p> <p id="demo"></p> <script> const time = new Date(); document.getElementById("demo").innerHTML = time; </script> </body> </html>