Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Date.prototype.getNormalizedTime = function () {
- function _wrap(a) {
- return a < 10 ? `0${a}` : a;
- }
- return [_wrap(this.getHours()), _wrap(this.getMinutes())].join(':');
- }
- console.log(new Date().getNormalizedTime());
Advertisement
Add Comment
Please, Sign In to add comment