Romanovich095

Untitled

Sep 14th, 2018
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Date.prototype.getNormalizedTime = function () {
  2.     function _wrap(a) {
  3.         return a < 10 ? `0${a}` : a;
  4.     }
  5.  
  6.     return [_wrap(this.getHours()), _wrap(this.getMinutes())].join(':');
  7.  
  8. }
  9.  
  10. console.log(new Date().getNormalizedTime());
Advertisement
Add Comment
Please, Sign In to add comment