- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2025 09:45 PM
Hello @Ankur Bawiskar , @Dr Atul G- LNG , @J Siva
There is a time difference when setting the value in a field with type date and time.
In the SOAP request body, I have received the value (2025-05-27 09:00:00) (UTC timezone)
when I set this value in one of the field in ServiceNow , the time difference is of one hour - it is setting time as 08:00:00 instead of 09:00:00
User's profile is also having timezone as UTC but still 1 hour difference on the field.
I am directly setting the value in the transform script like, fetching it from soap request payload and setting it to the field in servicenow
FYI - Time zone is UTC (soap request body) and in ServiceNow user's profile time zone is also UTC but still 1 hour difference on the field.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2025 09:54 PM
please use setValue() while setting so that it sets in GMT
In form or list it will display based on timezone of the user
something like this
sn_task.setValue('u_pending_until', pendingUntil); // pendingUntil is the value I am fetched from the SOAP body.
sn_task.update();
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2025 09:53 PM
Hi @Dinesh90
What about the instance timezone? Instead of checking the user timezone, you need to verify the instance timezone, as scripts use the instance timezone rather than the logged-in user's timezone.
Regards,
Siva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2025 09:54 PM
please use setValue() while setting so that it sets in GMT
In form or list it will display based on timezone of the user
something like this
sn_task.setValue('u_pending_until', pendingUntil); // pendingUntil is the value I am fetched from the SOAP body.
sn_task.update();
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2025 10:04 PM
Thank for your reply @Ankur Bawiskar
I will try this but wants to check - GMT & UTC are same thing right ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2025 10:05 PM
yes both are same
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader