Date count down

by GOKILAVANI 2014-04-25 09:31:03

Date count down

Example

There are only
2435 days 14 hours and 40 minutes left
Until December 25th 2020

Source code

Change the date that is bold to own special date to get the own customized date countdown.

javascript function:

today = new Date();

BigDay = new Date("December 25, 2020");
msPerDay = 24 * 60 * 60 * 1000 ;
timeLeft = (BigDay.getTime() - today.getTime());
e_daysLeft = timeLeft / msPerDay;
daysLeft = Math.floor(e_daysLeft);
e_hrsLeft = (e_daysLeft - daysLeft)*24;
hrsLeft = Math.floor(e_hrsLeft);
minsLeft = Math.floor((e_hrsLeft - hrsLeft)*60);
document.write("There are only

" + daysLeft + " days " + hrsLeft +" hours and " + minsLeft + " minutes left

Until December 25th 2020

");

881
like
0
dislike
0
mail
flag

You must LOGIN to add comments