Created
January 27, 2020 14:05
-
-
Save moshiurse/a7d08471c20037783ccf0118c466156a to your computer and use it in GitHub Desktop.
Get Remaining date
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var rem = new Date('2020-05-05') - new Date(); | |
var days = Math.floor(rem / 86400000); | |
var hour = Math.floor((rem % 86400000)/3600000); | |
var min = Math.floor(((rem % 86400000) % 3600000) / 60000); | |
var second = Math.round((((rem % 86400000) % 3600000) / 60000)/1000); | |
var remaining = days + ' days ' + hour + ' hour ' + min + ' Minute ' + second + ' second.'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment