How to get last day of the month

后端 未结 9 1007
闹比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:35

    var month = 1; // 1 for January
    var d = new Date(2015, month, 0);
    console.log(d); // last day in January
    

提交回复
热议问题