JS Code
Copy Code code as follows:
<script language= "JavaScript" >
function realsystime (clock) {
var now=new Date (); Creating a Date Object
var year=now.getfullyear (); Get year
var month=now.getmonth (); Get month
var date=now.getdate (); Get Date
var day=now.getday (); Get Week
var hour=now.gethours (); Get hours
var minu=now.getminutes (); Get minutes
var sec=now.getseconds (); Get seconds
month=month+1;
var arr_week=new Array ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
var week=arr_week[day]; Get a week in Chinese
var time=year+ "Year" +month+ "month" +date+ "Day" +week+ "+hour+": "+minu+": "+sec"; Combined system time
Clock.innerhtml=time; Show System time
}
Window.onload=function () {
Window.setinterval ("Realsystime (Clock)", 1000); Get and display system time in real time
}
</script>
To show where to add: id= "Clock" for example: <TD id= "Clock"/>