Last active
August 29, 2015 14:05
-
-
Save tadeubdev/969a249e68e3ac55f341 to your computer and use it in GitHub Desktop.
Utilizo essa função quando preciso retornar o time do JScript e calcular em segundos.
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
// Retorna o `Date.getTime()` removendo os milisegundos. | |
time = function() | |
{ | |
return new Date().getTime().toString().substring(0,10); | |
}; | |
// Ex.: | |
setInterval(function() | |
{ | |
console.log( 'Time in seconds: ' + time() ); | |
}, 1 * 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment