calculate current timestamp js code example Example 1: js timestamp var timestamp = new Date().getTime(); Example 2: js get current timestamp Date.now();