function nowTime(format)
{
var dt=new Date();//年份
this.Year=dt.getFullYear();//月份
this.Month=dt.getMonth()+1;//日期
this.Day=dt.getDate();//星期几,数字
this.Week=dt.getDay();//星期几，中文
this.WeekDay='日一二三四五六'.charAt(dt.getDay()); //24制小时
this.Hours24=dt.getHours();//12制小时
this.Minutes=dt.getMinutes();//秒
this.Seconds=dt.getSeconds();
if(this.Day<=9)
	this.Day="0"+this.Day;
if(this.Month<=9)
	this.Month="0"+this.Month;
if(this.Minutes<=9)
	this.Minutes="0"+this.Minutes;
if(this.Seconds<=9)
	this.Seconds="0"+this.Seconds;
if(this.Hours24<=9)
	this.Hours24="0"+this.Hours24;
format=format.replace("yy",this.Year);
format=format.replace("MM",this.Month);
format=format.replace("dd",this.Day);
format=format.replace("hh",this.Hours24);
format=format.replace("mm",this.Minutes);
format=format.replace("ss",this.Seconds);
format=format.replace("ww",this.Week);
format=format.replace("WW",this.WeekDay); 
//时间显示在页面中哪个标签里，这里是其id
this.toShow=function (element)
{
      document.getElementById(element).innerHTML=format;
} 
}


