Javascript examples for Date Operation:Month
Get date of last day of previous month
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*from w ww . j av a2s . c om*/ var Month = 8; var Year = 2013; var FirstDay = new Date(Year, Month, 1); var LastDayPrevMonth = new Date(FirstDay - 864e5); document.body.innerHTML = LastDayPrevMonth; } </script> </head> <body> </body> </html>