Created
February 16, 2011 21:52
-
-
Save mishudark/830315 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 hoy = new Date(); | |
| var futuro = new Date(2011,02,30); | |
| var diff = futuro-hoy; | |
| diff /= 1000; | |
| var days = Math.floor(diff / (60*60*24) - 27); | |
| diff = diff - (days+27) *(60*60*24); | |
| var hours = Math.floor(diff/(60*60)); | |
| diff = diff - hours * (60*60); | |
| var mins = Math.floor( diff / 60 ); | |
| var secs = Math.floor(diff - mins * 60); | |
| alert(days+' '+hours+':'+mins+':'+secs); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment