You are here: irt.org | FAQ | JavaScript | Date | Q1649 [ previous next ]
Try:
<script language="JavaScript"><!-- var now = new Date(); now = new Date(now.getFullYear(),now.getMonth(),now.getDate(),0,0,0); // midnight var text = '<form><select>'; for (i=0; i<7; i++) { var theDay = new Date(now.getTime()+(i*24*60*60*1000)); text += '\n<option> ' + theDay.getFullYear() + '/' + (theDay.getMonth()+1) + '/' + theDay.getDate(); } text += '</select></form>'; document.write(text); //--></script>