|
Q1512 How can I countdown to the 17th of May - when I graduate?
irt.org | Knowledge Base | JavaScript | Date | Q1512 [ previous next ]
Q1512 How can I countdown to the 17th of May - when I graduate?
Try:
<script language="JavaScript"><!--
now = new Date();
// 4th javascript month is May
future = new Date(2000,04,17,now.getHours(),now.getMinutes(),now.getSeconds());
aDay = 24*60*60*1000;
days = 0;
for (i=now.getTime(),n=future.getTime();i<n;i=i+aDay) {
aDate = new Date(i);
weekDay = aDate.getDay();
if (weekDay != 6 && weekDay != 0) days++;
}
if (days>0) document.write(days +' left to graduation');
else if (days==0) document.write('Graduation today!!!');
else document.write('Well, did you graduate?');
//--></script>
|
Feedback on 'Q1512 How can I countdown to the 17th of May - when I graduate?'
|
|
Copyright © 1996-2009 irt.org, All Rights Reserved.