convert iso date to milliseconds in javascript

后端 未结 10 1948
不知归路
不知归路 2020-11-29 00:40

Can I convert iso date to milliseconds? for example I want to convert this iso

2012-02-10T13:19:11+0000

to milliseconds.

Because I

10条回答
  •  無奈伤痛
    2020-11-29 01:34

    Another possible solution is to compare current date with January 1, 1970, you can get January 1, 1970 by new Date(0);

    var date = new Date(); 
    var myDate= date - new Date(0);
    

提交回复
热议问题