Skip to content

Instantly share code, notes, and snippets.

@FreePhoenix888
Created October 2, 2020 10:01
Show Gist options
  • Save FreePhoenix888/b74c87b9ecb4ffa21472d1bcdd7d681a to your computer and use it in GitHub Desktop.
Save FreePhoenix888/b74c87b9ecb4ffa21472d1bcdd7d681a to your computer and use it in GitHub Desktop.
function getSecondsToTomorrow() {
let now = new Date();
let tomorrow = new Date(now.getFullYear(), now.getMonth(), now.getDate()+1);
let diff = tomorrow - now;
return Math.round(diff / 1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment