How can I obtain the last day of the month with the timestamp being 11:59:59 PM?
function LastDayOfMonth(Year, Month) { return new Date((new Date(Year, Month, 1)) - 1); } console.log(LastDayOfMonth(2009, 11))
Example:
> LastDayOfMonth(2009, 11) Mon Nov 30 2009 23:59:59 GMT+0100 (CET)