programming-examples/js/Date/Write a JavaScript function to get the month end date..js

10 lines
193 B
JavaScript
Raw Normal View History

2019-11-15 12:59:38 +01:00
function endOfMonth(date)
{
return new Date(date.getFullYear(), date.getMonth() + 1, 0);
}
dt = new Date();
console.log(endOfMonth(dt).toString());