Skip to content

Instantly share code, notes, and snippets.

@marti1125
Created August 22, 2013 22:30
Show Gist options
  • Save marti1125/6313617 to your computer and use it in GitHub Desktop.
Save marti1125/6313617 to your computer and use it in GitHub Desktop.
calculate hours
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