Last active
April 11, 2018 04:54
-
-
Save goelp/4fe0aee6c0eb0bf774e84ce0d0a0795b to your computer and use it in GitHub Desktop.
Timezone conversion in Javascript for Quickbooks API
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
/** 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