title: how to format mysql timestamp into mm/dd/yyyy H:i:s in javascript
body: <p>I am getting values from database which is a time stamp.And i need to convert it into mm/dd/yyyy H:i:s using javascript. i tried the following code. but its not working it firefox/ie.But its working in chrome..how to solve it.</p>
  
  <pre><code>function formatDate(value){
  if(value){
      Number.prototype.padLeft = function(base,chr){
          var  len = (String(base || 10).length - String(this).length)+1;
          return len &gt; 0? new Array(len).join(chr || '0')+this : this;
      }
  var d = new Date(value),
  dformat = [ (d.getMonth()+1).padLeft(),
              d.getDate().padLeft(),
              d.getFullYear()].join('/')+
             ' ' +
            [ d.getHours().padLeft(),
              d.getMinutes().padLeft(),
              d.getSeconds().padLeft()].join(':');
   return dformat;
  }
  </code></pre>
  
  <p>I am getting NaN/NaN/NaN/NaN/NaN/NaN in firefox and ie.Any help is much appreciated</p>