Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Transform map: How to change date/time to 24 hr format on stagging table record?

Ridhima_1
Tera Contributor

Hi,

We are sending date from an excel file to a ServiceNow through Transform map.
The date format in excel file is 5/23/2024 03:55:50 PM but in ServiceNow staging table record the date field (string type) is showing 2024-05-23 03:55:50 however it should in 24 hr format i.e. 2024-05-23 15:55:50.

We have tried using field map date format as yyyy-MM-dd HH:mm:ss or yyyy-MM-dd HH:mm:ss a but they didn't work.

Please assist here how to change the format in staging table record to 24 hours format.

Thanks in advance!

Regards

2 REPLIES 2

Ankur Bawiskar
Tera Patron

@Ridhima_1 

in source field it should be string and it should be stored as it is i.e. 5/23/2024 03:55:50 PM

Please check why in source field it's in wrong format.

once this is corrected you can use this in the date format on field map -> the a denotes AM or PM and will set target value accordingly

MM/dd/yyyy HH:mm:ss a

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Hi,

I am using the below date format and script to convert the source field value to string and then converting it 24 hr format. Is this correct?

Ridhima_1_0-1716455210876.png

Regards