How to get last day of the month

后端 未结 9 1006
闹比i
闹比i 2021-02-01 20:37

How can I obtain the last day of the month with the timestamp being 11:59:59 PM?

9条回答
  •  情歌与酒
    2021-02-01 21:20

    This will give you last day of current month.

    var t= new Date();
    alert(new Date(t.getFullYear(), t.getMonth() + 1, 0, 23, 59, 59));
    

提交回复
热议问题