When setting a date field using web services, a datetime value must be entered. The time and time zone following the date are used to determine the resulting date. When getting the date field through web services, the user's preferred time zone influences the resulting datetime, i.e. midnight in the user's time zone of the stored date (which is also displayed in the UI) is converted to the PST/PDT and sent to the web services user.
The following table gives several examples:
Datetime set in date field
Time Zone of the User
Date shown in UI
Datetime when getting the record2
Notes for example table:
- The user has set their time zone to GMT-6, but the DST affects the result.
- This is midnight of the date from the UI that is converted to the PST/PDT. Please note the time difference, which equals the difference between the user's preferred time zone and the PST/PDT.
- The datetime which is to be saved is not greater than midnight in the user's preferred time zone.
- To avoid problems with conversions, set the time zone of the web services employee to "(GMT-08:00) Pacific Time (US & Canada)" in Home > Set Preferences. Also, submit the datetimes for date fields as midnight and in PST/PDT (see the Setting Proper Date/Time section below). Doing this will result in no conversions or truncations (what is submitted will be identical to what is retrieved with web services).
- When changing time zone preferences the user must re-log using web services for the change to take effect. If the same session is used the old time zone will be used as well. Caching may also occur for a period after changing time zones.
- Users setting the field value need to pay attention to the DST offset, as it influences the decision point (midnight of user's time zone) according to which value is set to the field.
- If the time zone specified in set field request is different than the time zone of the user setting the field, the datetime is first converted to the time zone of the user and the date portion is stored. The time is then set to midnight and returned in PST. See the second row of the table for an example.
Setting Proper Date/Time Format for SuiteTalk (Web Services)
Setting of Date Time, Date or Time fields for Web Services using Date-Time-Timezone:
If the user does not indicate the Timezone on the request the Netsuite, will use its own system Timezone (PST UTC-8/PDT UTC-07):
Users can indicate an UTC Timezone by adding the 'Z' character at the end of the DateTime Format: