How can I convert a date into an integer?

后端 未结 4 1493
孤街浪徒
孤街浪徒 2021-02-02 05:48

I have an array of dates and have been using the map function to iterate through it, but I can\'t figure out the JavaScript code for converting them into integers.

This

4条回答
  •  再見小時候
    2021-02-02 05:53

    Here what you can try:

    var d = Date.parse("2016-07-19T20:23:01.804Z");
    alert(d); //this is in milliseconds
    

提交回复
热议问题