Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Timezone conversion in Javascript for Quickbooks API
/** Add hours to a given date object **/
Date.prototype.addHours = function(h) {
this.setTime(this.getTime() + (h*60*60*1000));
return this;
}
/** overall function to create QBO invoices **/
function generateInvoices(){
...
var invoiceDate = new Date();
invoiceDate.addHours(18); // to add 18 hours to the datetime object.
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment