This is a discussion on Countdown to the 17th of May - when I graduate within the HTML, CSS and Javascript Coding Techniques forums, part of the Web Development category; Hi all... Can anyone tell me how can i countdown to the 17th of May - when I graduate. Thanks in ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Hi all... <script language="JavaScript"> now = new Date(); // 4th javascript month is May future = new Date(2000,04,17,now.getHours(),now.getMinutes(),no w.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> Thanks... |
![]() |
| Thread Tools | |
| Display Modes | |
| |