Created
March 7, 2016 19:01
-
-
Save UlisesGascon/04d7c0c9494f981cb889 to your computer and use it in GitHub Desktop.
Conversion tiempo ms -> Horas, minutos, segundos y dias
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 t = Date.parse(endtime) - Date.parse(new Date()); | |
var seconds = Math.floor((t / 1000) % 60); | |
var minutes = Math.floor((t / 1000 / 60) % 60); | |
var hours = Math.floor((t / (1000 * 60 * 60)) % 24); | |
var days = Math.floor(t / (1000 * 60 * 60 * 24)); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
4.734039