function Time()
{
var theDate = new Date();
this.Year = theDate.getFullYear;
this.Mouth = theDate.getMonth;
this.Date = theDate.getDate();
this.Day = theDate.getDay();
this.LocalTimeString = theDate.toLocaleDateString();
this.CurrentTime = theDate.toLocaleTimeString();
if (typeof (Time._initialized) == "undefined")
{
Time.prototype.getChineseWeek = function(day)
{
var Chinese_Week = "";
switch (day)
{
case 1: Chinese_Week = "星期一"; break;
case 2: Chinese_Week = "星期二"; break;
case 3: Chinese_Week = "星期三"; break;
case 4: Chinese_Week = "星期四"; break;
case 5: Chinese_Week = "星期五"; break;
case 6: Chinese_Week = "星期六"; break;
case 7: Chinese_Week = "星期日"; break;
}
return Chinese_Week;
}
this._initialized = true;
}
if (typeof (Time._initialized) == "undefined")
{
Time.prototype.getLongTime = function()/* 格式:2009年6月9日 星期二 11:39:05 */
{
return this.LocalTimeString + " " + this.getChineseWeek(this.Day) + " " + this.CurrentTime;
}
this._initialized = true;
}
}
{
var theDate = new Date();
this.Year = theDate.getFullYear;
this.Mouth = theDate.getMonth;
this.Date = theDate.getDate();
this.Day = theDate.getDay();
this.LocalTimeString = theDate.toLocaleDateString();
this.CurrentTime = theDate.toLocaleTimeString();
if (typeof (Time._initialized) == "undefined")
{
Time.prototype.getChineseWeek = function(day)
{
var Chinese_Week = "";
switch (day)
{
case 1: Chinese_Week = "星期一"; break;
case 2: Chinese_Week = "星期二"; break;
case 3: Chinese_Week = "星期三"; break;
case 4: Chinese_Week = "星期四"; break;
case 5: Chinese_Week = "星期五"; break;
case 6: Chinese_Week = "星期六"; break;
case 7: Chinese_Week = "星期日"; break;
}
return Chinese_Week;
}
this._initialized = true;
}
if (typeof (Time._initialized) == "undefined")
{
Time.prototype.getLongTime = function()/* 格式:2009年6月9日 星期二 11:39:05 */
{
return this.LocalTimeString + " " + this.getChineseWeek(this.Day) + " " + this.CurrentTime;
}
this._initialized = true;
}
}