RsD0p9BK
2/13/2017 - 8:45 AM

unix_timestamp.js

// How do you get a timestamp in JavaScript?

x = Date.now;
if (!Date.now) {
  Date.now = function() { 
    return new Date().getTime(); 
  };
}

x = Math.round(+new Date()/1000);
x = Math.round(new Date().getTime()/1000);

// http://stackoverflow.com/questions/221294/how-do-you-get-a-timestamp-in-javascript