Skip to content

Instantly share code, notes, and snippets.

@3200pro
Created July 26, 2022 21:12
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 3200pro/cde15e38eeb93498d56c90ef0e165776 to your computer and use it in GitHub Desktop.
Save 3200pro/cde15e38eeb93498d56c90ef0e165776 to your computer and use it in GitHub Desktop.
Get the daily difference between two dates
const daysBetween = (date1, date2) => Math.ceil(Math.abs(date1 - date2) / (1000 * 60 * 60 * 24))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment