Javascript Date hhmm()

Description

Javascript Date hhmm()

Date.prototype.hhmm = function() {
   var hh = this.getHours().toString();
   var mm = this.getMinutes().toString();
   if(hh.length == 1){
      hh = '0' + hh;
   }/*from www  .  j  ava  2  s  .  c  o  m*/
   if(mm.length == 1){
      mm = '0' + mm;
   }
   return hh + mm;
};



PreviousNext

Related