获得当前毫秒数的方法

Posted Carina

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了获得当前毫秒数的方法相关的知识,希望对你有一定的参考价值。

  //第一种方法   1498627266000
            var timestamp1 =Date.parse(new Date());
            console.log(timestamp1);
            //第二种方法   1498627266558
            var timestamp2 =(new Date()).valueOf();
            console.log(timestamp2);
            //第三种方法   1498627266558
            var timestamp3 =new Date().getTime();

 

以上是关于获得当前毫秒数的方法的主要内容,如果未能解决你的问题,请参考以下文章