This operation takes no arguments and returns the NetSuite server time in GMT, regardless of a user’s time zone. Developers do not have to rely on client time when writing synchronization procedures because the client time may not be in sync with the NetSuite server time.
If you choose, you can write client code that takes the GMT returned by NetSuite and convert the time to your local time zone. The format of the dateTime value returned by getServerTime contains the integer-valued year, month, day, hour, and minute properties, a decimal-valued second property, and a boolean time-zoned property (timestamp) – for example, 2005-09-21T15:24:00.000-07:00, where 2005-09-21 is the date, 15:24:00.000 is the time and -07:00 is your own time zone offset if you choose to set one.
Any user with an active session can call getServerTime. There are no explicit permissions for this operation. For example, if you need to synchronize customer data with NetSuite, you can call getServerTime to initialize your synchronization process. To synchronize new or changed customer records, you can search customers and filter by lastModifiedDate using the value returned in getServerTime. To synchronize deleted customer records, you can call the getDeleted operation and use the value returned in getServerTime. This makes the synchronization process independent of your client time, which may not be in sync with the NetSuite server time and hence the timestamp we use to track changes.
Request
<soapenv:Envelope
xmlns:xsd='http://www.w3.org/2001/XMLSchema'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'
xmlns:platformCore='urn:core_2021_2.platform.webservices.netsuite.com'
xmlns:listRel='urn:relationships_2021_2.lists.webservices.netsuite.com'
xmlns:listAcct='urn:accounting_2021_2.lists.webservices.netsuite.com'
xmlns:platformMsgs='urn:messages_2021_2.platform.webservices.netsuite.com'>
<soapenv:Header>
<tokenPassport xsi:type='platformCore:TokenPassport'>
<account xsi:type='xsd:string'>{{accountId}}</account>
<consumerKey xsi:type='xsd:string'>{{consumerKey}}</consumerKey>
<token xsi:type='xsd:string'>{{tokenId}}</token>
<nonce xsi:type='xsd:string'>{{nonce}}</nonce>
<timestamp xsi:type='xsd:long'>{{timestamp}}</timestamp>
<signature algorithm='HMAC_SHA256' xsi:type='platformCore:TokenPassportSignature'>{{signature}}</signature>
</tokenPassport>
</soapenv:Header>
<soapenv:Body>
<getServerTime xsi:type='platformMsgs:GetServerTimeRequest'/>
</soapenv:Body>
</soapenv:Envelope>
Response
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<platformMsgs:documentInfo
xmlns:platformMsgs="urn:messages_2021_2.platform.webservices.netsuite.com">
<platformMsgs:nsId>WEBSERVICES_TSTDRV2782962_0731202313508880571129871496_72385</platformMsgs:nsId>
</platformMsgs:documentInfo>
</soapenv:Header>
<soapenv:Body>
<getServerTimeResponse
xmlns="">
<platformCore:getServerTimeResult
xmlns:platformCore="urn:core_2021_2.platform.webservices.netsuite.com">
<platformCore:status isSuccess="true"/>
<platformCore:serverTime>2023-07-31T22:03:46.000-07:00</platformCore:serverTime>
</platformCore:getServerTimeResult>
</getServerTimeResponse>
</soapenv:Body>
</soapenv:Envelope>