Skip to content

Instantly share code, notes, and snippets.

@harabchuk
Created May 16, 2015 13:32
Show Gist options
  • Save harabchuk/71a4258c43a80353c70d to your computer and use it in GitHub Desktop.
Save harabchuk/71a4258c43a80353c70d to your computer and use it in GitHub Desktop.
Add hours to JavaScript date
Date.prototype.addHours = function(h) {
this.setTime(this.getTime() + (h*60*60*1000));
return this;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment