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