Transform Maps Date/Time updating wrongly

Jake Adams
Tera Contributor

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

 

answer = (function transformEntry(source) {
var date= source.field_name;
var arrSplit = date.split(".");
var finalString = arrSplit[0].toString(); 
return finalString ();
 
})(source);

 

But the target date/time field is updated as 09/05/2024 15:07:19

 

Kindly assist.

15 REPLIES 15

Jake Adams
Tera Contributor

Can someone kindly assist on this?

 

Ankur Bawiskar
Tera Patron
Tera Patron

@Jake Adams 

while setting the value in field it will set in GMT.

you are receiving date/time value in GMT or some other timezone from the source?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi,

 

Thanks for the reply 

 

The source is using the Australian timezone

Hi @Ankur Bawiskar,

 

Kindly assist on this