Date.prototype.toString = function() {
var h,i,s,d,m,y;
h = this.getHours();
i = this.getMinutes();
s = this.getSeconds();
d = this.getDate();
m = this.getMonth() + 1;
y = this.getFullYear();
h = _2(h);i = _2(i);s = _2(s);
d = _2(d);m = _2(m);
return h + ":" + i + ":" + s + " " + d + "/" + m + "/" + y;
function _2(i){if (i < 10) i = "0" + new String(i); return i;}
}
var cur = new Date();
document.write(cur);
Title:
Re define toString function for Date object
Description:
Date.prototype.toString = function() { var h,i,s,d,m,y; h = this.getHours(); i = this.getMinutes(); s = this.getSeconds(); d = this.ge...
...
Rating:
4