Lucas
03/17/2023, 8:11 AMnlapiDateToString
and nlapiStringToDate
functions with the 'datetimetz' argument. This ensures that your dates are consistent across different time zones.
var dateInUTC = nlapiDateToString(new Date(), 'datetimetz');
var dateObj = nlapiStringToDate(dateInUTC, 'datetimetz');
2. Use date APIs: When working with dates, always use the appropriate NetSuite date APIs such as nlapiAddDays
, nlapiAddMonths
, nlapiDateToString
, and nlapiStringToDate
. These functions take care of the user's date preferences and time zone settings.
3. Check the time zone settings: Ensure that the time zone settings for the affected subsidiary are correct. Go to Setup > Company > Subsidiaries and edit the subsidiary. Check the 'Time Zone' field under the 'Address' subtab.
4. Check the date format settings: Ensure that the date format settings for the affected subsidiary are correct. Go to Setup > Company > Subsidiaries and edit the subsidiary. Check the 'Date Format' field under the 'Address' subtab.