|
II. Web Development Tips Add "today's date" to your web page
Want to add a date in your web page? Take this script and put it in the body of your html code where you want the date to appear.
<SCRIPT LANGUAGE="JavaScript"> <!-- Begin myvar = new Date(); Month = (myvar.getMonth() + 1) Year = (myvar.getYear()) if (Month == 1) {WordMonth = "Jan";} if (Month == 2) {WordMonth = "Feb";} if (Month == 3) {WordMonth = "March";} if (Month == 4) {WordMonth = "April";} if (Month == 5) {WordMonth = "May";} if (Month == 6) {WordMonth = "June";} if (Month == 7) {WordMonth = "July";} if (Month == 8) {WordMonth = "Aug";} if (Month == 9) {WordMonth = "Sept";} if (Month == 10) {WordMonth = "Oct";} if (Month == 11) {WordMonth = "Nov";} if (Month == 12) {WordMonth = "Dec";} document.write(WordMonth+". "+myvar.getDate()+", "+Year); // End --> </SCRIPT>
If you want the full month to show, just change the month in the code to a long format ("January") and you are ready to go!
|
|