Last active
July 13, 2018 06:42
-
-
Save savayer/7cf93418905485c4f33572ebf77098a6 to your computer and use it in GitHub Desktop.
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 remain_bv = 1200; //секунд | |
function timeLeft(timestamp){ | |
if (timestamp < 0) timestamp = 0; | |
var day = Math.floor( (timestamp/60/60) / 24); | |
var hour = Math.floor(timestamp/60/60); | |
var mins = Math.floor((timestamp - hour*60*60)/60); | |
var secs = Math.floor(timestamp - hour*60*60 - mins*60); | |
var left_hour = Math.floor( (timestamp - day*24*60*60) / 60 / 60 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment