ANS-0386 · SUITESCRIPT DEVELOPMENT

How Does NetSuite Handle Server Time and Scheduled Script Execution?

Understand NetSuite's server time, how scheduled scripts are queued, and how user timezones affect script execution context.

Short answer

NetSuite's server operates on Pacific Time (PST/PDT). Scheduled script times indicate queueing, not immediate execution, which depends on system availability. User timezones influence script display, but Administrator-run scripts use the Company Timezone. Modern SuiteScript uses `N/config` and `N/format` for timezone handling.

Scenario

Users often encounter discrepancies between displayed times in NetSuite and actual execution times, particularly with scheduled scripts. This can lead to confusion regarding when automated processes run and how time-sensitive data is processed, especially across different user timezones.

Solution

NetSuite's underlying server time is consistently set to Pacific Time (PST or PDT, depending on the time of year). This server time forms the basis for all internal system operations.When configuring scheduled scripts, the time specified for execution indicates when the script will be placed into NetSuite's processing queue, not the exact moment of execution. The actual execution begins when the queue is free and NetSuite is ready to process the script. While typical execution starts within 0 seconds and 5 minutes of being queued, delays of 15 minutes or more can occur, even when the queue appears empty.The displayed scheduled time for a script deployment is generally based on the time zone of the user viewing or scheduling it. However, it is crucial to note that scheduled scripts executed under the Administrator role will operate within the Company Timezone, not the individual user's timezone.To work with time in a user's specific format within NetSuite:

  1. Using Saved Searches

    A formula (date/time) field can incorporate the constant {today}. This will display the current date and time adjusted to the user's time zone settings.

  2. Using SuiteScript

    While new Date() in SuiteScript will return the server's Pacific Time, modern NetSuite SuiteScript (2.x) utilizes modules such as N/config and N/format for handling user timezones. These modules allow for retrieving user preferences and formatting dates and times accordingly.

Expert NetSuite Support

Need help with this NetSuite issue?

SuiteScript Development consulting and configuration support

Talk to a consultant