Skip to content

Instantly share code, notes, and snippets.

@jfolds
Last active April 18, 2019 22:20
Show Gist options
  • Save jfolds/6406ec3552e521baaf71e59ef7ca241f to your computer and use it in GitHub Desktop.
Save jfolds/6406ec3552e521baaf71e59ef7ca241f to your computer and use it in GitHub Desktop.
const timestamp = 1555624965730;
const timeCurrent = new Date().getTime();
const timeElapsed = Math.floor((tC - timestamp) / 1000 / 60); //get time elapsed
const timeSince = (tE > 60) ? Math.floor((tE * 60) / 3600) + ' hours ago' : tE + ' minutes ago';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment