Rob
04/16/2025, 10:26 PMCeligo AI
04/16/2025, 10:26 PMAI generated answer (using internal Slack threads):Yes, it is possible to calculate a date/time using the account's timezone via script in NetSuite. In SuiteScript, you can get the company's timezone using the
N/config
module. You can load the Company Information values to get this information. Here is a sample code snippet:
javascript
var config = require('N/config');
var companyInfo = config.load({
type: config.Type.COMPANY_INFORMATION
});
var companyTimeZone = companyInfo.getValue('TIMEZONE');
However, it's important to note that there is not necessarily a User in the Scheduled Script context. If the user is calling an on-demand scheduled script that needs the user's timezone, you could have the calling script (User Event, Client Script?) determine the user's timezone and pass it as a parameter to the scheduled script. If no timezone is provided via parameter, you could default to the Company Timezone.
For calculating the difference between two dates considering timezone, you might need to use NetSuite's format timezone functions or just add / subtract hours using native Date methods.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
04/16/2025, 10:26 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.831846774
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.828874886
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.821652532
Celigo AI
04/16/2025, 10:26 PM