You are here: irt.org | FAQ | JavaScript | Date | Q1512 [ previous next ]
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>