<!DOCTYPE html>
<html>
<head>
  <link rel='stylesheet' href='style.css'/>
  <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300' rel='stylesheet' type='text/css'>
</head>
<body>
  <section>
    <!--
      Change "Mike" to your own name!
      
      (I'm a comment. You won't see me on the page.)
    -->
    <h1>Mike's New Year</h1>
    <div>happening in just</div>
    <section class="countdown">
      <div><div id="d"></div>days</div>
      <div><div id="h"></div>hours</div>
      <div><div id="m"></div>min</div>
      <div><div id="s"></div>sec</div>
    </section>

    <h1>This year, I want to:</h1>
    <!--
      What do you want to do?
      Add them here in between "<li>" and "</li>"
    -->
    <ol>
      <li>
        Inspire all my students
      </li>
      <li>
        Encourage students to become "life long learners"
      </li>
      <li>
        <a href="http://viereckquestion.blogspot.com/">Create a safe and welcoming learning enviornment</a>
      </li>
    </ol>
  </section>

  <script src='script.js'></script>
</body>
</html>
* { box-sizing: border-box; }

body {
    background: #ff9999;
    font-family: 'Open Sans', sans-serif;
    font-weight: 300;
    color: #222;
}

h1 {
    font-weight: 300;
    font-size: 2em;
    padding-bottom: 0;
    margin-bottom: 6px;
}

h1:last-of-type {
    margin-top: 36px;
}

section > div {
    display: inline-block;
    margin: 0  4px;
}

section > div > div {
    background: white;
    padding: 8px;
    font-size: 1.2em;
}

section {
    padding: 12px;
    border-radius: 12px;
    text-align: center;
}

ol {
    padding: 0;
    margin: 0;
    margin-top: 18px;
}

li {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

a {
    color: #222;
}

a:link {text-decoration:none;}
a:visited {text-decoration:none;}
a:hover {text-decoration:underline;}
a:active {text-decoration:underline;}
// What year are we in now?
var now = new Date();
var current_year = now.getFullYear();
var next_year = current_year + 1;

// Set the date we're counting down to.
var target_date = new Date("Jan 1, " + next_year).getTime();
 
// Variables for time units.
var days, hours, minutes, seconds;
 
// Get the elements that will hold the numbers.
var $days = document.getElementById("d");
var $hours = document.getElementById("h");
var $minutes = document.getElementById("m");
var $seconds = document.getElementById("s");

// Calculate the countdown clock and set the HTML.
function update() {
    // Find the amount of "seconds" between now and target.
    var current_date = new Date().getTime();
    var seconds_left = (target_date - current_date) / 1000;
 
    // Do some time calculations.
    days = parseInt(seconds_left / 86400);
    seconds_left = seconds_left % 86400;
     
    hours = parseInt(seconds_left / 3600);
    seconds_left = seconds_left % 3600;
     
    minutes = parseInt(seconds_left / 60);
    seconds = parseInt(seconds_left % 60);
     
    // Format the number strings and put them in the elements.
    $days.innerHTML = pad(days, 2);
    $hours.innerHTML = pad(hours, 2);
    $minutes.innerHTML = pad(minutes, 2);
    $seconds.innerHTML = pad(seconds, 2);
}

// Immediately update the HTML.
// The white boxes are blank otherwise.
update();

// Now update our number elements every 1 second.
setInterval(update, 1000); // 1000 milliseconds = 1 second

// This looks much better with leading zeros, don't you agree?
// If num has less than size digits, add enough 0s to the front.
function pad(num, size) {
    var s = num+"";
    while (s.length < size) s = "0" + s;
    return s;
}

Browse more Codebits