I need to convert the date to a format, for example. 2011-01-02 - unix timestamp in JavaScript, but doesn’t know exactly how to execute it. I can get the current timestamp using the following functions Math.round((new Date()).getTime() / 1000);, but don’t know how to convert this date to a unix timestamp?
source
share