Skip to content

Instantly share code, notes, and snippets.

@kemalkanok
Created April 16, 2014 21:21
Show Gist options
  • Save kemalkanok/10934333 to your computer and use it in GitHub Desktop.
Save kemalkanok/10934333 to your computer and use it in GitHub Desktop.
geri sayac js
function divInt(a,b)
{
return parseInt(a/b);
}
function calctime()
{
var goal = new Date("2014 5 3 10:00:00");
var now = new Date();
result = divInt(goal - now,1000);
sn = result % 60;
result = divInt(result,60);
dk = result % 60;
result = divInt(result,60);
saat = result % 24;
result = divInt(result,24);
gun = result;
console.log(gun+" "+saat+ " " + dk + " " + sn);
setTimeout(function() {
calctime();
}, 999);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment