Javascript examples for Date:setUTCMonth
Set the month to 4 (May) and the day to the 20th:setUTCMonth(4, 20)
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/*from w ww . j ava 2 s. co m*/ var d = new Date(); d.setUTCMonth(4, 20); document.getElementById("demo").innerHTML = d; } </script> </body> </html>