|
|
#1 (permalink) |
|
co-admin
Join Date: Oct 2006
Location: Belgium
Posts: 666
|
Tutorial Name: Show current date
Description: Use this script to write the current date to your web page. Author: !i! Army !i! Difficulty: beginner Details: <!-- Copy this code into the BODY of your HTML document --> [HTML]<SCRIPT LANGUAGE="JavaScript1.2"> <!-- Begin var months=new Array(13); months[1]="January"; months[2]="February"; months[3]="March"; months[4]="April"; months[5]="May"; months[6]="June"; months[7]="July"; months[8]="August"; months[9]="September"; months[10]="October"; months[11]="November"; months[12]="December"; var time=new Date(); var lmonth=months[time.getMonth() + 1]; var date=time.getDate(); var year=time.getYear(); if (year < 2000) // Y2K Fix, Isaac Powell year = year + 1900; // http://onyx.idbsu.edu/~ipowell document.write("<center>" + lmonth + " "); document.write(date + ", " + year + "</center>"); // End --> </SCRIPT> </CENTER>[/HTML] |
|
|
|