How to get Timestamp in Javascript

The timestamp in JavaScript is expressed in milliseconds
In UNIX timestamp, you have the timestamp in second counting from 1970

If you are given the timestamp you can use the following code to get the date string

You can use the following code to get the timestamp form the date object