JavaScript gets the current timestamp:
The first method:
var timestamp = (new Date());
Result: 1280977330000
The second method:
var timestamp = (new Date()).valueOf();
Result: 1280977330748
The third method:
var timestamp=new Date().getTime();
Result: 1280977330748
The first type: the timestamp obtained is to change milliseconds to 000 display.
The second and third are to obtain the timestamp of the current millisecond.
The above is the entire content of this article, I hope you like it.