Javascript Date get_time()

Description

Javascript Date get_time()


Date.prototype.get_time = function() {
  var hour   = this.getHours(),
      minute = this.getMinutes(),/*from   www .ja  v  a 2  s .  c  o m*/
      second = this.getSeconds();
  if (hour < 10)
    hour = "0" + hour;
  if (minute < 10)
    minute = "0" + minute;
  if (second < 10)
    second = "0" + second;
  return hour + ":" + minute + ":" + second;
}



PreviousNext

Related