Generate an epoch.

Javascript's Date Object always works in milliseconds, but most date/time code works on unix epochs. This is just a quickie one-off function designed to give you an epoch to work with.

function timestamp() {
    return Math.round(Date.now() / 1000);
}

Author: Don Burks
Tags: date

comments powered by Disqus