Skip to content

Instantly share code, notes, and snippets.

@niksumeiko
Last active December 18, 2015 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niksumeiko/5806576 to your computer and use it in GitHub Desktop.
Save niksumeiko/5806576 to your computer and use it in GitHub Desktop.
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