Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <body> <h1>JavaScript Dates</h1> <h2>The setSeconds() Method</h2> <p>The setSeconds() method sets the seconds of a date object (0-59).</p> <p id="demo"></p> <script> const d = new Date("January 01, 2025"); d.setSeconds(30); document.getElementById("demo").innerHTML = d; </script> </body> </html>