battk
03/09/2020, 8:22 AMSMNCP
03/09/2020, 9:23 AMSMNCP
03/09/2020, 9:26 AMvar currentDateTime = new Date();
var companyTimeZone = nlapiLoadConfiguration('companyinformation').getFieldText('timezone');
var timeZoneOffSet = (companyTimeZone.indexOf('(GMT)') == 0) ? 0 : new Number(companyTimeZone.substr(4, 6).replace(/\+|:00/gi, '').replace(/:30/gi, '.5'));
var UTC = currentDateTime.getTime() + (currentDateTime.getTimezoneOffset() * 60000);
var companyDateTime = UTC + (timeZoneOffSet * 60 * 60 * 1000);
nlapiLogExecution('DEBUG', "Current Company Time", "companyDateTime = " + companyDateTime);
var d = new Date(companyDateTime);
nlapiLogExecution('DEBUG', "Current Company Time", "Date/Time = " + d);
battk
03/09/2020, 9:37 AMbattk
03/09/2020, 9:40 AM