Date/Time format is changing will importing through Transform Map

Anubhav Ritolia
Kilo Contributor

Hi All,

When I am trying to import value for Date/Time field, and it the hours is 12, it is automatically converting it to 00. But it is working properly when it is 13Hr or even 23Hr.

For example, If I import 2020-03-05 12:50:40 in system it comes as 2020-03-05 00:50:40.

But, If I import 2020-03-05 13:50:40 in system it comes as 2020-03-05 13:50:40 properly. 

Also there is no AM or PM mentioned. What can be the issues?

This is happening for all Date/Time fields present in my table.

 

1 ACCEPTED SOLUTION

AnubhavRitolia
Mega Sage
Mega Sage

Hi All,

 

Issue was solve just by changing the Date/Time Format in Field mapping from yyyy-mm-dd hh:mm:ss to yyyy-mm-dd HH:mm:ss.

 

Just changed hh to HH format.

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023

View solution in original post

11 REPLIES 11

Dhruv Gupta1
Kilo Sage
Kilo Sage
One quick suggestion while importing make the field in import set as of type string. And the transform it to date time field then it should behave based on the configuration like 12 hr or 24 hr format

Hi Dhruv,

 

Yes the field is string type only in source table and transforming it same way. you can refer the screenshot I have attached.

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

please share what format you are selecting and the field map or any script you are using?

Thanks
Ankur

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

Anubhav Ritolia
Kilo Contributor

Hi All,

 

Please find the Field mapping below:

find_real_file.png