Skip to content

Instantly share code, notes, and snippets.

@Athira2199
Created December 15, 2020 12:39
Show Gist options
  • Save Athira2199/1d055ce2d377a80b0e101572275b0d7e to your computer and use it in GitHub Desktop.
Save Athira2199/1d055ce2d377a80b0e101572275b0d7e to your computer and use it in GitHub Desktop.
const timeLapsedSince = (createdOn)=>{
let lapsedTime = new Date().getTime()-new Date(createdOn).getTime() // time in milliseconds
// time in days
let timeInDays = lapsedTime(86400 * 1000)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment