Countdown Time

Time when I can graduate.

by Fajar Purnama

HTML

<body>
Graduation will be every September 25: <br/>
<p id="days"></p><p>days</p><p id="hours"></p><p>hours</p><p id="minutes"></p><p>minutes</p><p id="seconds"></p><p>seconds</p> <br/>
Regards.
</body>

<!-- The code below is for bittube airtime monetization, you may ignore, or are you interested? you can make yours here https://bittube.app/?ref?2JY4FE0CP -->
<meta name="airtime-platform-display" content="jsfiddle.net.0fajarpurnama0">
<meta name="airtime-platform-id" content="70437240-ae18-efdd-ab00-0c83e35039af">
<script src="https://bittubeapp.com/tubepay/airtime.loader.js" data-verify="meta" data-autostart="true"></script>
<!-- bittube airtime code ends -->

CSS

p {
  font-size: 15px;
  font-weight: bold;
  display: inline-block;
  padding: 10px;
  background: lightgreen;
  margin: 0 0 20px;
  color: black;
  text-shadow: 2px 2px 5px blue;
  border-style: solid;
  border-width: thin;
}

JavaScript

$(document).ready(function(){
	$future = new Date();
  $future.setMonth(9);
  $future.setDate(25);
  function timer(){
		$now = new Date();
  	$difference = $future - $now;
  	$days=Math.floor($difference/(60*60*1000*24));
  	$hours=Math.floor(($difference%(60*60*1000*24))/(60*60*1000)*1);
  	$minutes=Math.floor((($difference%(60*60*1000*24))%(60*60*1000))/(60*1000)*1);
  	$seconds=Math.floor(((($difference%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1);
    $('#days').text($days);
    $('#hours').text($hours);
    $('#minutes').text($minutes);
    $('#seconds').text($seconds);
  }
  
  setInterval(timer, 1000);
});