this.toSimpleDate = function() {
return this.year + "-" + this.month + "-" + this.date;
};
this.toDetailDate = function() {
return this.year + "-" + this.month + "-" + this.date + " " + this.hour + ":" + this.minute + ":" + this.second;
};
this.display = function(ele) {
var clock = new Clock();
ele.innerHTML = clock.toString();
window.setTimeout(function() {clock.display(ele);}, 1000);
};
}
/*使用的时候应该先包含本js文件
<SCRIPT src="js/Clock.js" mce_src="js/Clock.js" type=text/javascript></SCRIPT>
<td align="left" class="admin_txt" id=clock></td>
<SCRIPT type=text/javascript>
var clock = new Clock();
clock.display(document.getElementById("clock"));
</SCRIPT>
*/