1// Return today's date and time
2var currentTime = new Date()
3
4// returns the month (from 0 to 11)
5var month = currentTime.getMonth() + 1
6
7// returns the day of the month (from 1 to 31)
8var day = currentTime.getDate()
9
10// returns the year (four digits)
11var year = currentTime.getFullYear()
12
13// write output MM/dd/yyyy
14document.write(month + "/" + day + "/" + year)