Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Please note that on Saturday, April 18, 2026, at 8:00 PM Pacific Time, our Case Management System will undergo a scheduled maintenance for approximately 15 minutes. During this time, case creation via SuiteAnswers will be unavailable and inbound calls will be routed to Customer Service.
ClientServerTimeService - small class to work with server-synched time on the client
I have many client operations that need to be time-synched with the server.
I started having code littered all over the place and decided to wrap it up into a neat little object.
Here is the first pass of this class (and some usage examples):
/** * Small class that will attempt to deliver the server time on the client. * Pretty narrow scope, basically only usefull in my SuiteLets. The SuiteLet * adds a hidden text field that will have the server time set just before * the response is returned. Then on the client side when this class is instantiated * it will read the server time from the hidden field and calculate the differential. */ function ClientServerTimeService() { var _serverTime = DateUtils.CreateDateFromMilliseconds( nlapiGetFieldValue(ClientServerTimeService.SRVR_TIME_FLD_ID)); var _serverLocalDifferential = _serverTime.getTime() - new Date().getTime(); /** * Returns the calculated server time based on the server-set Steve Klett | Senior Developer
NetValue Technology
0