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