Created
August 22, 2013 22:30
-
-
Save marti1125/6313617 to your computer and use it in GitHub Desktop.
calculate hours
This file contains hidden or 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
Number.prototype.pad = function (len) { | |
return (new Array(len+1).join("0") + this).slice(-len); | |
} | |
var rumboAGrau = new Date('1988','01','01',''+result.GRAU[i].substr(0,2)+'',''+result.GRAU[i].substr(3,5)+'') | |
var rumboAGrauHora = rumboAGrau.getHours().pad(2) + ":" | |
+ rumboAGrau.getMinutes().pad(2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment