Javascript Date time24()

Description

Javascript Date time24()

Date.prototype.time24 = function()
{
 var hours = "" + this.getHours();
 var minutes = "" + this.getMinutes();
 var seconds = "" + this.getSeconds();

 if(hours.length < 2)
  hours = "0"+hours;

 if(minutes.length < 2)
  minutes = "0"+minutes;

 if(seconds.length < 2)
  seconds = "0"+seconds;


 return hours+":"+minutes+":"+seconds;
}



PreviousNext

Related