Javascript method to find number of milliseconds from 1970

This question already has an answer here:

  • How do you get a timestamp in JavaScript? 35 answers

  • 使用getTime函数:

    var dt = new Date('2012-01-01');
    var time = dt.getTime();
    

    You can get it with:

    new Date('2012-01-01').getTime();
    

    The getTime() method returns the number of milliseconds between midnight of January 1, 1970 and the specified date.

    链接地址: http://www.djcxy.com/p/13562.html

    上一篇: Web浏览器的时间戳?

    下一篇: Javascript方法从1970年开始查找毫秒数