<script> var d = new Date; alert(new Date(d.getFullYear(), d.getMonth() + 1, 0, 23, 59, 59)); </script>