Javascript examples for Date:setDate
Set the day of the month, to a specified date:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {//ww w .j a v a2 s . co m var d = new Date("July 21, 2020 01:15:00"); d.setDate(15); document.getElementById("demo").innerHTML = d; } </script> </body> </html>