Transform Maps Date/Time updating wrongly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2024 11:25 PM
Hi,
The Target Date/Time is updating by adding extra 2 or 3 hours
For e.g:) My Source field string field value is 2024-05-09 11:29:47.0
Using the source script in the field mapping I am removing the .0
But the target date/time field is updated as 09/05/2024 15:07:19
Kindly assist.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2024 05:07 AM
so do this
1) convert the time from australian time to GMT and then use set value
2) please check which timezone it is since Australia has 5 timezones
refer my blog to convert the timezone and then use that in onBefore transform script don't use field map script
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-25-2024 09:53 PM
Hi,
Just checked both the Source date and Instance is also in the Australian time zone which means the Target field should also hold the Australian time zone but still as I mentioned when the source updates to the target its updating it wrongly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2024 03:16 AM - edited 05-30-2024 07:06 PM
Looking further into this, it seems that it is treating the Source date&time as being from UTC time and while it's transformed to Target date&time field it's always adding extra 10hrs or 2hrs or 3hrs.
How to fix this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2024 08:27 PM
while setting value it will set in UTC
Convert the incoming value to GMT and then set and it will work fine
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-31-2024 03:03 AM
Hi @Ankur Bawiskar,
I tried it using the below: