Created
September 26, 2014 15:30
-
-
Save linus-amg/ffe88f1475552130c78d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log(new Date().time(),'[INFO]','Testing...'); | |
Number.prototype.pad = function (len) { | |
return (new Array(len+1).join('0') + this).slice(-len); | |
}; | |
Date.prototype.time = function () { | |
var dateMS = this; | |
return dateMS.getHours().pad(2)+':'+dateMS.getMinutes().pad(2)+':'+dateMS.getSeconds().pad(2); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment