Can someone please help me with my understanding of nlapiStringToDate. In particular using a format datetimetz.
The documentation says that using a format of datetimetz when calling nlapiStringToDate returns the date in the time zone of the user's netsuite preference not the browser.
For example nlapiStringToDate('3/22/2013 10:00:00 AM','datetimetz') on the client side results in a date object with the timezone of the machine not the user preference.
On the server side the time zone of the resulting date object is always GMT -8 regardless of the user's netsuite time zone preference.
***UPDATE If the value is retrieved from a custom field of type datetime, the time portion of the resulting date is the correct time in the users timezone as set in their preferences but the date object is in the time zone of the server. After reading more about the javascript date object this seems by design.
The client side problem still remains but only when calling nlapiStringToDate in a custom script. Again if a custom field in the ui is of datetime the time portion displayed will be converted into the time of the current user as set under their user preferences.