Javascript examples for Date:setUTCDate
Set the day of the month to be the last day of the previous month: setUTCDate(0)
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/*from w w w .j a v a2 s .co m*/ var d = new Date(); d.setUTCDate(0); document.getElementById("demo").innerHTML = d; } </script> </body> </html>