How to get last day of the month

后端 未结 9 1002
闹比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

    Last day of the month

    now = new Date
    lastDayOfTheMonth = new Date(1900+now.getYear(), now.getMonth()+1, 0)
    

提交回复
热议问题