Sometimes you need operate Unix timestamp, so there is how you can get it: Date.prototype.getTimestamp = function() { return parseInt((this.getTime()-Date.UTC(1970,0,1))/1000); } Note: If you’d like to use timestamp with milliseconds, just don’t divide by 1000 in above method. After that for example you are able to use this method to …