Skip to content

Commit

Permalink
minor fixes in computation
Browse files Browse the repository at this point in the history
  • Loading branch information
Raj Chandra authored Oct 22, 2018
1 parent a182ecb commit fa882e8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ <h2 id="demo"></h2>

// Find the distance between now an the count down date
var distance = countDownDate - now;

let oneDay = 86400000; //number of milli-seconds in a day
// Time calculations for days, hours, minutes and seconds
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var days = Math.floor(distance / oneDay);
var hours = Math.floor((distance % oneDay) / (1000 * 60 * 60));
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((distance % (1000 * 60)) / 1000);

Expand Down

0 comments on commit fa882e8

Please sign in to comment.