Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
JavaScript function that returns current UNIX timestamp (eg 1371570826).
// Returns UNIX timestamp.
// Sometimes visible in different JavaScript developers teams as now().
function getUNIXTimestamp() {
return Math.round((new Date()).getTime() / 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment