Possible Duplicate:
How do you get a timestamp in JavaScript?
Calculating milliseconds from epoch可能重复:如何在JavaScript中获得时间戳?计算毫秒的时代
How can I get the current epoch
time in Javascript? Basically the number of milliseconds since midnight, 1970-01-01.
如何在Javascript中获得当前的历元时间?从午夜开始的毫秒数,1970-01-01。
2 个解决方案
#1
375
var milliseconds = (new Date).getTime();
#2
45
new Date().valueOf()
will do the trick.
new Date(). valueof()将发挥作用。
#1
375
var milliseconds = (new Date).getTime();
#2
45
new Date().valueOf()
will do the trick.
new Date(). valueof()将发挥作用。