Skip to content

Instantly share code, notes, and snippets.

@cieux1
Created October 24, 2013 02:56
Show Gist options
  • Select an option

  • Save cieux1/7130562 to your computer and use it in GitHub Desktop.

Select an option

Save cieux1/7130562 to your computer and use it in GitHub Desktop.
function diffDay(y,m,d) {
var diff = Math.floor((new Date(y,m-1,d) - new Date()) / 86400000) + 1;
document.getElementById("count_down_image").innerHTML = '<img src="' + diff + '_days_left.png" />';
}
diffDay(2013,12,31);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment