Skip to content

Instantly share code, notes, and snippets.

@mohamedsaqer
Created June 16, 2019 10:34
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 mohamedsaqer/4c42b2a9c52c62799caa56db91ca653d to your computer and use it in GitHub Desktop.
Save mohamedsaqer/4c42b2a9c52c62799caa56db91ca653d to your computer and use it in GitHub Desktop.
Difference in time react-native
var msDiff = new Date(this.state.expire_date).getTime() - new Date().getTime(); //Future date - current date
var daysTill = Math.floor(msDiff / (1000 * 60 * 60 * 24));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment