Remove Seconds/ Milliseconds from Date convert to ISO String

前端 未结 9 1892
滥情空心
滥情空心 2020-12-15 15:41

I have a date object that I want to

  1. remove the miliseconds/or set to 0
  2. remove the seconds/or set to 0
  3. Convert to ISO string

F

9条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-15 15:55

    let date = new Date();
    date = new Date(date.getFullYear(), date.getMonth(), date.getDate());
    

    I hope this works!!

提交回复
热议问题