Here you can find the source of timeNow()
// For the time now Date.prototype.timeNow = function () { return ((this.getHours() < 10)?"0":"") + this.getHours() +":"+ ((this.getMinutes() < 10)?"0":"") + this.getMinutes(); } // Returns the current time in "HH:MM XM" format function theTime() { var newDate = new Date(); var hh_mm = newDate.timeNow(); if (newDate.getHours() >= 12) { hh_mm += " PM"; if (newDate.getHours() > 12) { hh_mm = hh_mm.slice(2, hh_mm.length); hh_mm = (newDate.getHours() - 12) + hh_mm; }/*w w w . j a va2 s . c o m*/ } else { hh_mm += " AM"; } return hh_mm; } $('#time').text(theTime());
Number.prototype.from_now = function() { var d = new Date(); return (d.getTime() + this); };
Number.prototype.from_now = function () { var i = this.valueOf(); var t = new Date().getTime(); return new Date(t + i); };
Date.prototype.timeNow = function(){ return ((this.getHours() < 10)?"0":"") + this.getHours() +":"+ ((this.getMinutes() < 10)?"0":"") + this.getMinutes() +":"+ ((this.getSeconds() < 10)?"0":"") + this.getSeconds(); };
Date.prototype.timeNow = function () { return ((this.getHours() < 10) ? "0" : "") + this.getHours() + ((this.getMinutes() < 10) ? "0" : "") + this.getMinutes() + ((this.getSeconds() < 10) ? "0" : "") + this.getSeconds(); };
Date.prototype.timeNow = function () { return ((this.getHours() < 10)?"0":"") + this.getHours() +":"+ ((this.getMinutes() < 10)?"0":"") + this.getMinutes() +":"+ ((this.getSeconds() < 10)?"0":"") + this.getSeconds();
Date.prototype.timeNow = function () { return ((this.getHours() < 10)?"0":"") + this.getHours() +":"+ ((this.getMinutes() < 10)?"0":"") + this.getMinutes();
Date.prototype.timeNow = function(){ return ((this.getHours() < 10)?"0":"") + ((this.getHours()>12)?(this.getHours()-12):this.getHours()) +":"+ ((this.getMinutes() < 10)?"0":"") + this.getMinutes() +":"+ ((this.getSeconds() < 10)?"0":"") + this.getSeconds() + ' ' + ((this.getHours()>12)?('PM'):'AM'); };
Date.prototype.timeNow = function(){ return ((this.getHours() < 10)?"0":"") + ((this.getHours()>12)?(this.getHours()-12):this.getHours()) + ":" + ((this.getMinutes() < 10)?"0":"") + this.getMinutes() + ":" + ((this.getSeconds() < 10)?"0":"") + this.getSeconds() + ((this.getHours()>12)?(' PM'):' AM'); };
Date.now = function() { return new Date().getTime();